drvxclagw656708070
2012-01-25 09:37
浏览 18
已采纳

setMissingLast in PECL Solr

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?

图片转代码服务由CSDN问答提供 功能建议

问题: 项目有可选价格。 如果价格为0(或者如果它有帮助我可以将其更改为null),那么在显示文档时,这些文档需要在按价格排序时最后排序。 经过长时间的搜索,我认为setMissingLast会帮助最多,但我没有看到在PECL Solr中设置setMissingLast选项的任何方法(我们不能仅为此事改变搜索库)。 < 我也试图使用map(price,0,0,999)函数查询(仅在排序升序时)。

如何在PECL Solr中为price字段设置setMissingLast,或者 有没有其他解决方案可以确保丢失的价格文件总是排在最后?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dqkf49487 2012-01-25 10:29
    已采纳

    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.

    点赞 评论

相关推荐 更多相似问题