0

I use full text search on my SynonymWords table. I need to find exact word. I put my search word between quotes but it still to get result. I expected there is no result. Where i do a mistake?

My query is

SELECT * FROM SynonymWords WHERE CONTAINS(Words,'"zebra"')

The result is here

Full Text Search Result

Yargicx
  • 1,704
  • 3
  • 16
  • 36

1 Answers1

0

Fulltext index doesn't work that way

it would find Zebra as long as there is a space or an interpunct before and behind it, so that ozt can idenitfy it a a word.

That's the function of the full text search and you can't change it.

A word like zebrajsduerhn would not be found by your query

You would change it to

SELECT * FROM SynonymWords WHERE CONTAINS( [words], '"zebra*"') 

It taes some time to get used to it

Iyou want to have an exact search for word i would recoment to read this thread SQL Server query to match the exact word which handles this and also have an answer for regular expressions.

If you need something faster you should take a look at elasticsearch and opensearch, but these needs also some time to undertsand the concepts

nbk
  • 45,398
  • 8
  • 30
  • 47