Solr 不匹配。阈值设置,或者什么奇怪的?

发布于 2024-12-07 07:35:53 字数 389 浏览 1 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热鲨 2024-12-14 07:35:53

我见过一些奇怪的行为! 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.

绮烟 2024-12-14 07:35:53

对于那些追随我的人,我找到了一个解决方案,但不一定是对其行为的解释。

Solr 查询:

(PostBody:There are tall people outside) AND !UserId:2

按照我上面的要求工作。请注意,如果在正文周围添加引号,则它不匹配。我相信 Solr 尝试将此类查询匹配为单个字符串而不是单个单词。

For those who come after me, I found a solution however not necessarily an explanation for its behavior.

The Solr query:

(PostBody:There are tall people outside) AND !UserId:2

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文