PECL Solr 中的 setMissingLast
问题: 商品有可选价格。如果价格为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你的意思是
sortMissingLast
。您不需要库来支持它,只需在 solr 架构。I think you mean
sortMissingLast
. You don't need your library to support it, you just have to addsortmissingLast=true
in your fieldType definition within the solr schema.