这些 Solr 查询如何/为何产生不同的结果?
我正在使用 Apache Solr 并使用具有文本字段 PostBody
、整数 Userid
字段和基于 trie 的日期时间字段 MostRecentActivityDate< 的架构查询索引。 /代码>。
我正在尝试将查询时间提升应用于我的 select
查询,以便通过某种因素提升最近的帖子以帮助评分。我对此的价值观是尝试以天为时间尺度,而不是像许多在线日期提升示例中那样以年为时间尺度。
以下两个查询产生不同的结果,唯一不同的是增强“代码”的实际放置位置(即在字段条件本身之前或之后)。在我的测试中,我还注意到,当没有 {} 增强代码时,它们都会产生不同的结果,因此在某种情况下它不会被忽略。
有谁能够解释为什么他们会产生不同的结果?谢谢!
{!boost%20b=recip(ms(NOW,MostRecentActivityDate),1.16e-7,1,1)} (PostBody:"timmy is great and that is a fact") AND !Userid=2
对比。
(PostBody:"timmy is great and that is a fact") AND !Userid=2 {!boost%20b=recip(ms(NOW,MostRecentActivityDate),1.16e-7,1,1)}
I'm using Apache Solr and querying an index with a schema that has a text field PostBody
, a integer Userid
field, and a trie based datetime field MostRecentActivityDate
.
I'm attempting to apply query-time boosting to my select
query such that more recent posts are boosted by some factor to assist in scoring. My values for this are in attempts to have a timescale of days rather than years as in many online date boosting examples.
The following two queries produce different results, the only thing being different in them is where the "code" for the boosting is actually placed (i.e. prior to or after the field conditionals themselves). In my testing I've also noticed that they both produce different results from when there is no {} boosting code, so its not as if in one case its being ignored.
Is anyone able to explain why they would produce different results? Thanks!
{!boost%20b=recip(ms(NOW,MostRecentActivityDate),1.16e-7,1,1)} (PostBody:"timmy is great and that is a fact") AND !Userid=2
Vs.
(PostBody:"timmy is great and that is a fact") AND !Userid=2 {!boost%20b=recip(ms(NOW,MostRecentActivityDate),1.16e-7,1,1)}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于这对于您的数据来说非常具体,因此了解正在发生的情况的最佳方法是打开 查询调试 - 通过搜索的
debugQuery=on
参数。这里有两个链接可以帮助解释调试输出。Since this will be very specific to your data, the best way to figure out what is happening, is to turn on query Debugging - via the
debugQuery=on
parameter of your search. Here are two links that help explain the debug output.