这些 Solr 查询如何/为何产生不同的结果?

发布于 2024-12-14 21:42:39 字数 725 浏览 2 评论 0原文

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

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

发布评论

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

评论(1

山川志 2024-12-21 21:42:39

由于这对于您的数据来说非常具体,因此了解正在发生的情况的最佳方法是打开 查询调试 - 通过搜索的debugQuery=on 参数。这里有两个链接可以帮助解释调试输出。

  • 调试搜索应用程序相关性 - 说明
  • <一个href="http://wiki.apache.org/solr/SolrRelevancyFAQ#Why_does_id%3aarchangel_come_before_id%3ahawkgirl_when_querying_for_.22wings.22" rel="nofollow">为什么查询“wings”时 id:archangel 出现在 id:hawkgirl 之前< /a>

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.

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