请问如何让数据库全文索引,支持数字和字母查询,CONTAINS(column,'SearchKey')

hjw0571 2006-01-23 10:42:00
我建立的全文索引,好象只支持两个以上中文字的查询,就是SearchKey必须是两个以上汉字,
怎样让它 变成和like一样的功能,可以是数字和字母
...全文
299 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
javanow 2006-02-08
  • 打赏
  • 举报
回复
这叫干扰词
select * from table where contains(column,'"*我*"')
查询。注意我加了 * 和 双引号。

http://community.csdn.net/Expert/topic/4488/4488417.xml?temp=.5359156

他的意思是,*号放搜索词前后表示前后缀。

如果你搜索 a ,可能会出现这种问题,如果你使用 "a*" ,则表示以 a 为前缀的词,如 ab,ac
那自然就不是干扰词了。

那段英文也我看了很久,才看个明白。

The CONTAINS syntax requires double quotation marks for prefix ("choc*") and for multiple word or phrase searches ("chocolate chip" or "oatmeal"). This can be problematic in terms of UI design, because users are not accustomed to having to properly quote their searches and are prone to making mistakes when they do. A simple function is needed that developers can use to properly quote a query string before passing it to SQL Server.


--------------------------------
http://chinadba.cn
深圳骄子数据库技术网
最具实战经验的数据库优化、管理、设计、培训
网站大提速,欢迎访问。
kimurakenshin 2006-02-08
  • 打赏
  • 举报
回复
用*

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧