全文搜索:正在搜索噪音词 [英] Full Text Search: Noise words are being searched for

查看:123
本文介绍了全文搜索:正在搜索噪音词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有SQL Server 2008中的全文搜索索引的数据库。我在Stoplist中定义了Stopword'al'。然而,当我搜索关键字'al'的任何短语时,'al'这个单词仍然是排名靠前的。



这可能与I分解搜索条件并重构它们。然后我搜索多个字段并对结果进行排名: http://pastebin.com/fdce11ff 。此功能打破搜索

 'al hamra'
$ b $转换为

 (* al *〜* hamra * )或全文检索(* al *或* hamra *)



想象一下这种情景:

名称:
Al Hamra,作者:Jack Brown,类型:小说
Al Karawan,作者:Al Hanz,流派:爱情

现在搜索'al hamra'尽管事实上'al'在禁止列表中,'Al Karawan'。为什么是这样?我认为stoplists会导致单词失去他们的权重?

解决方案

噪音字是特定于代码页的;你有没有把它添加到正确的?您可以使用 sys.dm_fts_parser 进行测试(下面),这也是可能会比你在代码中的手动分词(或没有)更好。

  SELECT special_term,display_term 
FROM sys.dm_fts_parser
(''al hamra'',1033, 0,0)

假设您正在使用代码页1033.如果您的噪音词在代码页中您期望它应该在列表中显示为噪音词。


I have a database in SQL Server 2008 with Full Text Search indexes. I have defined the Stopword 'al' in the Stoplist. However, when I search for any phrase with the keyword 'al', the word 'al' is still uesd in ranking.

This might be related to the fact that I am breaking up search terms, and reconstructing them. I am then searching across multiple fields and ranking the results: http://pastebin.com/fdce11ff. This functions to break up a search

'al hamra' 

into

("*al*" ~ "*hamra*") OR ("*al*" OR "*hamra*") 

for the Full Text Search.

Imagine this scenario:

Name: Al Hamra, Author: Jack Brown, Genre: Fiction Al Karawan, Author: Al Hanz, Genre: Romance

Now a search for 'al hamra' will return 'Al Karawan', in spite of the fact that 'al' is in the stoplist. Why is this? I thought stoplists would cause words to lose their weightage?

解决方案

Noise words are specific to code pages; have you added it to the right one? You can use sys.dm_fts_parser to test it (below) this also might work better than your manual word breaking in the code (or not).

SELECT special_term, display_term
FROM sys.dm_fts_parser
  (' "al hamra" ', 1033, 0, 0)

Assuming you are using code page 1033. If your noise word is in the code page you expect then it should be visible as a noiseword in the list.

这篇关于全文搜索:正在搜索噪音词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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