[Answer]-Selective sorting in solr

1👍

The boost in edismax can be used for this. It is applied to all scores, but if it is a small value, it will only make a difference for ties or near-ties. Significant differences in the base score will not be reordered.

See: http://wiki.apache.org/solr/ExtendedDisMax#boost_.28Boost_Function.2C_multiplicative.29

0👍

I have no knowledge of django or django-haystack, but if you want secondary sorting in solr you just specify multiple sorts as a comma seperated list. Example…

score desc, priority desc

…would sort documents by score, and if two documents have identical scores would then sort by the priority field.

Note however that this will only provide a secondary sort for things that have exactly the same score value — you may instead want to “boost” the scores of your documents (ie: actually affect the score, prior to sorting) by your priority field.

👤Hoss

Leave a comment