Shubham Kumar Yadav
Shubham Kumar Yadav

Reputation: 89

MS SQL Server : Full text search Not working when using Wild Card in Contains

I am trying to search from table using keywords and it works fine when I do not use wildcards.

CONTAINS(CP.Course, '"B.A" OR "B.E/B.Tech"')

But it does not shows any records when I use this:

CONTAINS(CP.Course, '"*B.A*" OR "*B.E/B.Tech*"')

Is there any reason for it? Since wild card is used as both prefix and suffix so any matching record should be shown. But it shows none.

Upvotes: 0

Views: 1023

Answers (1)

helix
helix

Reputation: 376

SQL Server full-text search does not support search by prefix asterisk.

So, while "B.A*" is a valid term, "*B.A*" and "*B.A" are not.

https://learn.microsoft.com/en-us/sql/t-sql/queries/contains-transact-sql

Upvotes: 1

Related Questions