使用“AND”时遇到问题在 CONTAINSTABLE SQL SERVER 全文搜索中
我已经使用全文有一段时间了,但有时我似乎无法获得最相关的结果。
如果我有一个类似于 An Overview of Pain Medicine 5/12/2006
的字段,并且用户输入 An Overview 5/12/2006
那么我们创建一个搜索,例如:
"An" AND "Overview" AND "5/12/2006"
- 0 个结果(坏)
"Overview" AND "5/12/2006"
- 1 个结果 (好)
我的查询的 CONTAINSTABLE 部分:
FROM ce_Activity A
INNER JOIN
CONTAINSTABLE(View_Activities,(Searchable), @Search) AS KeyTbl ON A.ActivityID = KeyTbl.[KEY]
“可搜索”是一个字段,其中包含活动标题和开始日期(转换为字符串),因此所有搜索都很友好。
为什么会出现这种情况呢?
[更新]
好的,我刚刚测试了噪音词理论。我使用了“Pain”AND“Overview”AND“5/12/2006”,效果很好。
但如果我添加“of”,它就会失败。 “Of”和“An”一定是干扰词。
现在的问题是,如果存在干扰词,如何使其忽略这些词,而不是将其从结果中删除?
有什么建议吗?
I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes.
If I have an field with something like An Overview of Pain Medicine 5/12/2006
and a user types An Overview 5/12/2006
So we create a search like:
"An" AND "Overview" AND "5/12/2006"
- 0 results (bad)
"Overview" AND "5/12/2006"
- 1 result (good)
The CONTAINSTABLE portion of my query:
FROM ce_Activity A
INNER JOIN
CONTAINSTABLE(View_Activities,(Searchable), @Search) AS KeyTbl ON A.ActivityID = KeyTbl.[KEY]
"Searchable" is a field contains the activity title, and start date(converted to string) in one field so it's all search friendly.
Why would this happen?
[UPDATE]
Okay I just tested the NOISE word theory. I used "Pain" AND "Overview" AND "5/12/2006"
and it works fine.
But if I add "of" it fails. 'Of' and 'An' must be noise words.
Now the question is, how do I make this just IGNORE the words, instead of removing it from the result if a noise word exists?
Any tips?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您当前的分词系统将“an”视为噪音。
Perhaps your current word breaker ignores "an" as noise.