开发者

SQL Server fulltext search does not return all the results

开发者 https://www.devze.com 2023-01-22 07:20 出处:网络
I tried to use full-text search for a table called \"Business\" in SQL Server 2008. Here is the statement (the search term is in Chinese).

I tried to use full-text search for a table called "Business" in SQL Server 2008. Here is the statement (the search term is in Chinese).

select * from Business biz where CONTAINS(biz.*,'家具')

And then I use like statement to do the same

select * from Business where Name like '%家具%'

The full-text search returns 8 results and the like search returns 9 results which is wh开发者_如何学Pythonat I expected. Does anyone know what might cause this?


I don't know the Chinese language, so I can't say for sure, but here's my best guess.

SQL Server's fulltext searching is word based, while LIKE is looking for character patterns within a string. As an example in English, a CONTAINS search for "warn" would not find the word "forewarned", but a LIKE for '%warn%' would.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号