Solved

SQL Server Full Text Search - AND searches across multiple columns

Posted on 2010-11-24
1
420 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Detach & Attach 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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

912 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

19 Experts available now in Live!

Get 1:1 Help Now