Solr 增强多值日期字段

发布于 2025-01-03 06:48:28 字数 175 浏览 2 评论 0原文

我有一个 Solr 索引,每个文档都是一个事件的信息。在我的架构中 Schedule 是日期类型的多值字段。 我想知道是否可以增加带有计划日期的文件 (多值字段中的任何日期)在未来并且最接近当前日期? 我正在使用 Dismax 查询和 SolrNet 客户端 api。

I have a Solr index and each document is the information of an Event. In my schema Schedule is a multivalued field of type date.
I am wondering if it is possible to boost the documents with a schedule date
(any of those dates in the multivalued field) in the future and closest to the current date?
I am using Dismax query and SolrNet client api.

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

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

发布评论

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

评论(1

强辩 2025-01-10 06:48:28

您可以使用 Solr FunctionQuery - recip

函数查询示例:

recip(ms(NOW/HOUR,_datefield_),3.16e-11,1,1)

另请阅读相关性常见问题解答:http://wiki.apache.org/solr/SolrRelevancyFAQ# How_can_I_boost_the_score_of_newer_documents

You can user Solr FunctionQuery - recip.

Example function query:

recip(ms(NOW/HOUR,_datefield_),3.16e-11,1,1)

Also read relevancy FAQ: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_boost_the_score_of_newer_documents

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