根据日期和条件增强 Solr

发布于 2024-11-04 02:13:09 字数 289 浏览 4 评论 0原文

我正在尝试提升 Solr 查询中的新文档。 ms函数Solr FAQ似乎是正确的方法,但我需要添加附加条件: 我使用爬网网页中的上次修改日期作为要考虑的日期,但这并不总是提供有意义的日期。因此,我希望该函数仅增强上次修改日期中找到的日期(而不是时间)与时间戳不同的文档,从而消除仅返回当前日期作为上次修改日期的结果。感谢建议!

I am trying to boost newer documents in Solr queries. The ms function Solr FAQ seems to be the right way to go, but I need to add an additional condition:
I am using the last-Modified-Date from crawled web pages as the date to consider, and that does not always provide a meaningful date. Therefore I would like the function to only boost documents where the date (not time) found in the last-Modified-Date is different from the timestamp, eliminating results that just return the current date as the last-Modified-Date. Suggestions are appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

夜空下最亮的亮点 2024-11-11 02:13:09

您可能确实想在业务层中执行此操作,正如 baja fresh 所建议的那样。然而,有一种纯粹的 Solr 方法可以做到这一点:只需使用 map 函数来映射(timestamp,timestamp)now 范围内的任何内容。

You probably do want to do it in the business layer, as baja fresh suggested. However, there is a pure Solr way to do it: just use the map function to map anything in the range (timestamp,timestamp) to now.

后eg是否自 2024-11-11 02:13:09

在索引期间,应用您的逻辑并将日期添加到“date_boost”字段。在搜索期间,使用 date_boost 字段进行提升。

During indexing, apply your logic and add the date to a "date_boost" field. During search time, boost using the date_boost field.

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