PECL Solr 中的 setMissingLast

发布于 2024-12-28 18:04:47 字数 302 浏览 7 评论 0原文

问题: 商品有可选价格。如果价格为0(或者如果有帮助的话我可以将其更改为null),那么在显示文档时,按价格排序时需要将这些文档排在最后。经过长时间的搜索,我认为 setMissingLast 会有所帮助,但我没有看到任何在 PECL Solr 中设置 setMissingLast 选项的方法(而且我们不能仅仅为此更改搜索库)。

我还尝试使用 map(price,0,0,999) 函数查询(仅在升序排序时),但没有成功。

如何在 PECL Solr 中为价格字段设置 setMissingLast,或者是否有其他解决方案来确保丢失的价格文档始终排在最后?

Problem:
Items have optional price. If the price is 0 (or I can change it to null if it helps), then when displaying documents, those documents need to be sorted last when sorting by price. After long searching I think setMissingLast would help most, but I don't see any way of setting setMissingLast option in PECL Solr (and we can't change a search library just for this thing).

I also tried without success to use map(price,0,0,999) function query (only when sorting ascending).

How can I set setMissingLast for price field in PECL Solr, or are there any other solutions for making sure missing price documents are always sorted last?

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

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

发布评论

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

评论(1

囍笑 2025-01-04 18:04:47

我认为你的意思是sortMissingLast。您不需要库来支持它,只需在 solr 架构

I think you mean sortMissingLast. You don't need your library to support it, you just have to add sortmissingLast=true in your fieldType definition within the solr schema.

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