solr 属性值为null的doc排序靠后

解决方案:

<field>标签添加一个属性:sortMissingLast="true"

例子:

<field name="price" type="tdouble" indexed="true" stored="true" sortMissingLast="true"/>

 不管是 :sort= price asc 还是  sort= price desc 

没有值的记录都会排到最后。

猜你喜欢

转载自limeng650419.iteye.com/blog/2265989