Solr Facet Filter - q 与 fq 返回不同的结果?
谁能告诉我为什么这些 Solr 查询会返回截然不同的结果:
q=BBC+Food&fq=Source:"BBC-WORLDWIDE"
第
q=(BBC+Food)+AND+(Source:"BBC-WORLDWIDE")
一个返回 6 个结果,后者返回 58 个结果。
Can anybody tell me why these Solr queries would return vastly different results:
q=BBC+Food&fq=Source:"BBC-WORLDWIDE"
and
q=(BBC+Food)+AND+(Source:"BBC-WORLDWIDE")
The first returns 6 results, and the latter 58.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您能否将
&debugQuery=on
添加到查询末尾,并查看调试输出中的值是否有助于了解两个查询之间的差异?Can you add
&debugQuery=on
to the end of your queries and see if the values in the debug output lend any insight into the different between the two queries?事实证明,第一个查询正在搜索同时包含 BBC AND Food 一词的文档。第二个查询使用 OR 逻辑搜索任一单词。
通过将关键字放在括号中,并将其与任何其他子句组合,Solr 似乎反转了关键字隐含的“AND”逻辑,而是应用“OR”逻辑。
以下查询更好地证明了这一点:
它们都返回非常不同的结果,因为关键字应用了相反的逻辑。
It turns out that the first query is searching for documents that contain both the words BBC AND Food. The second query is searching for either of the words using OR logic.
By placing the keywords in parenthesis, and combining it with any other clause, Solr appears to be inverting the implied "AND" logic for the keywords and instead applying "OR" logic.
The following queries demonstrate this a little better:
They both return very much different results because the keywords have reversed logic applied.