michal.jakubeczy
michal.jakubeczy

Reputation: 9469

%LIKE% replacement with CONTAINS

We are changing our queries from:

SELECT * FROM {table} WHERE colname LIKE '%search term%'

to:

SELECT * FROM {table} WHERE CONTAINS(colname, '"search term"')

Unfortunately it does not seem to be 100% equivalent to "two way like".

If I use entire word "search term" it is fine and expected results are returned, but if I enter "earch ter" no results are returned. We also tried

SELECT * FROM {table} WHERE CONTAINS(colname, '"earch ter*"')

but it only works fine if I enter "search".

So is there any operator to 100% mimic %LIKE% functionality with contains.

Upvotes: 2

Views: 347

Answers (1)

gofr1
gofr1

Reputation: 15977

No, there is no 100% mimic %LIKE% operator in full-text search. More info you can find on MSDN the part with Supported Forms of Query Terms title.

Upvotes: 3

Related Questions