Reputation: 2000
I have implemented full-Text search in my application for searching a keyword from a table in my database.Now i want to extend the search for multiple words.I googled for it but didnt get the answer i wanted.Can anyone tell how to extend the search for multiple keywords.
Query:
select ProductCode,CategorySequenceNumber from tblProductMaster where Contains(*,@stringToSearch)
Any suggessions will be appriciated..
Upvotes: 0
Views: 1465
Reputation: 334
Use FREETEXT function intead of CONTAINS. seperate your keywords with spaces.
Upvotes: 0
Reputation: 1398
Pass in your keywords separated by "AND" or "OR" depending on the behavior you want :
SET @stringtosearch = '"this" AND "word" OR "test"'
Upvotes: 2
Reputation: 789
You can split the search text at spaces to a string array and then search for each of the elements.
Upvotes: 0