Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi CP

I'm having trouble with an Fulltext Index.

If I search for Banana I get rows with Fruit and so on, why ??? what im I missing here ?

SQL
SELECT * FROM text_search WHERE CONTAINS(textvalue, '"Banana"')
Posted

1 solution

Among other things, "CONTAINS" returns synonym, note the last item:
Quote:
CONTAINS can search for:
A word or phrase.
* The prefix of a word or phrase.
* A word near another word.
* A word inflectionally generated from another (for example, the word drive is the inflectional stem of drives, drove, driving, and driven).
* A word that is a synonym of another word using a thesaurus (for example, the word "metal" can have synonyms such as "aluminum" and "steel").

from CONTAINS (Transact-SQL)[^]
++++++[Round 2]++++++
If are looking for pattern match, try LIKE[^]. E.g.
SELECT * FROM text_search WHERE textvalue LIKE '%Banana%'
 
Share this answer
 
v5
Comments
Maciej Los 4-Mar-15 14:01pm    
+5
Peter Leow 4-Mar-15 20:55pm    
Thank you, Maciej.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900