根据日期和条件增强 Solr
我正在尝试提升 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能确实想在业务层中执行此操作,正如 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)
tonow
.在索引期间,应用您的逻辑并将日期添加到“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.