sorting - Solr boost query sort by whether result is boosted then by another field -
i'm using solr run query on 1 of our cores. suppose documents have 2 fields: id, , name. have separate list of ids i'm grabbing database , passing query boost results.
if document gets returned in query , id in list goes top of results, , if gets returned in query , id not in list goes below in list. former "boost". query - http://mysolrserver:8983/solr/mycore/myqueryhandler?q=smith&start=0&rows=25&bq=id%3a(36+or+76+or+90+or+224+or+391)
i able boost query working need boosted results in alphabetical order name, non boosted results under in alphabetical order name. need know user &sort= parameter. &sort=score%20desc,name+asc not work. i've looked on lot of documentation, still don't know if possible. appreciated. thanks!
solr version 6.0.1. using solrnet interface solr, think can figure out solrnet part if know url's &sort= parameter value needs be.
the closest match requirement query elevation component[1] . in particular case first sort ids according requirements ( sorting them name example), maintain them in elevate.xml.
at query time can use "forceelevation" parameter force elevation , sort remaining results name.
[1] https://cwiki.apache.org/confluence/display/solr/the+query+elevation+component
Comments
Post a Comment