Solr 不匹配。阈值设置,或者什么奇怪的?
我正在使用 solr 来搜索文章。我创建了 2 个测试“身体”句子,其中包含常用词“高”,但没有匹配项。
查询---> Body:"外面有高个子的人" AND !UserId:2
与帖子不匹配:
Body: KU 塔真的很高 UserId:3
这只是一个非常低的匹配分数吗?还是还有其他事情发生?在匹配分数低的情况下,真的应该这么低吗?正文句子非常短并且共享一个共同的单词,我希望有一些匹配。
编辑:我认为由于存在 !UserId: 2 条件而没有发生匹配。如果我尝试在没有这个的情况下匹配正文句子,那就非常自由了。谁能解释一下吗?也许如何最好地构建查询以避免这种类型的特定行为?
谢谢!
I'm using solr to search for articles. I created 2 test "body" sentences which have the common word "tall", but there is no match.
The Query---> Body:"There are tall people outside" AND !UserId:2
Does not match a post with:
Body: the KU tower is really tall
UserId:3
Is this just simply a very low matching score? or is there something else going on here? In the case of a low matching score should it really be that low? The body sentences are very short and share a common word, I would have expected some match.
EDIT: I think the matching isn't happening as a result of having the !UserId: 2 condition. If I try to match body sentences without that, its very liberal. Can anyone explain this? and perhaps how to best structure a query to avoid this type of specific behavior?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我见过一些奇怪的行为! Solr 的运算符。我建议您使用 -(负指示符),如 SolrQuerySyntax Wiki 页面 中所示。尝试将原始查询更改为
Body:"There are high people Outside" AND -UserId:2
看看是否符合您的预期。I have seen some funky behavior with the ! operator with Solr. I would suggest you use the - (negative indicator) instead as shown in the SolrQuerySyntax Wiki Page. Try changing your original query to
Body:"There are tall people outside" AND -UserId:2
to see if that works as you are expecting.对于那些追随我的人,我找到了一个解决方案,但不一定是对其行为的解释。
Solr 查询:
按照我上面的要求工作。请注意,如果在正文周围添加引号,则它不匹配。我相信 Solr 尝试将此类查询匹配为单个字符串而不是单个单词。
For those who come after me, I found a solution however not necessarily an explanation for its behavior.
The Solr query:
worked as I desired above. Note that if the quotes are added around the body, it does not match. I believe Solr attempts to match such a query as a single string rather than individual words.