solr boost query with separate sort

后端 未结 2 420
野趣味
野趣味 2021-01-28 17:25

I want to demote all documents that have inv=0(possible values from 0 to 1000) to the end of the result set. i have got other sorting options like name desc also as part of the

2条回答
  •  情歌与酒
    2021-01-28 18:07

    Default sorting criteria in Solr is score desc, where score is a virtual field and it actually represents the document's score.
    Once one is passing &sort=name asc it will override default sorting.

    Possible solution here might be something like this: &sort=score desc, name asc. Which literally means: please sort by score first and for documents with equal score please make a tie-break by name ascending.

    It should work as long as you will have equal scores for doc1, doc2, doc5, doc6.

    If it is not the case - then check out this Solr Wiki link for more details how to penalize docs with inv:0.

提交回复
热议问题