开发者

Using Full-Text-Search in order to find partial words (SQL Server 2008)

开发者 https://www.devze.com 2023-01-02 15:36 出处:网络
I\'m trying to build a facebook like search for my software. I\'d like to query the table customers. I\'ve set up a FULLTEXT Index and tried the next query

I'm trying to build a facebook like search for my software.

I'd like to query the table customers.

I've set up a FULLTEXT Index and tried the next query

SELECT * FROM Customer where CONTAINS(*,'*ann*')

The query does return all the customers named Ann, but i开发者_C百科t doesn't return all the customers name Anne.

Is there a way to create prefix search on SQL Server 2008 using FTS?


I've found a solution to my problem. The query should be:

select * from Customers where contains(*, '"ann*"')

The quotes are the important part.

0

精彩评论

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