Solved

SQL Server Full Text Search - AND searches across multiple columns

Posted on 2010-11-24
1
419 Views
Last Modified: 2012-06-21
Does anyone know how to accomplish this?  The search below only returns results when a specific column matches both words.  I want it to match if all words are matched, but in any full-text indexed column.  Anyone know if this is do-able?

DECLARE @keywords nvarchar(100);
SET @keywords = '"William*" AND "Travis*"';

SELECT RANK AS RES_RANK, * FROM VW_REQUESTOR_AGENCY_SEARCH,
CONTAINSTABLE (VW_REQUESTOR_AGENCY_SEARCH, *,  @keywords) AS TBL_SCH
WHERE [KEY] = VW_REQUESTOR_AGENCY_SEARCH.REQUESTOR_ID

Open in new window

0
Comment
Question by:msdcdev
1 Comment
 
LVL 1

Accepted Solution

by:
msdcdev earned 0 total points
ID: 34209643
According to several articles, the answer is to add a computed column on the view that concatenates all of the fields that you want to search.  Then, change your full text index to only include the computed column.  Then the query shown above works with no changes.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now