使用全文搜索为了查找部分单词(SQL Server 2008) [英] Using Full-Text-Search in order to find partial words (SQL Server 2008)

查看:82
本文介绍了使用全文搜索为了查找部分单词(SQL Server 2008)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想查询表格客户。



我建立了一个FULLTEXT索引并尝试了下一个查询

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

查询确实会返回所有名为Ann的客户,但它没有返回所有的客户名称安妮。



有没有办法在SQL Server 2008上使用FTS创建前缀搜索?

解决方案

我找到了解决我的问题的方法。
查询应该是:

  select * from customers where contains(*,'ann *')

引号是重要的部分。


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 it 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.

这篇关于使用全文搜索为了查找部分单词(SQL Server 2008)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆