I need to sort documents returned in order of (descending) score & (descending) value of an int field within the document. How do I ensure proper sort order as well as good performance ?
I don't need the sort-order defined by sort=score desc,intField desc.
The sort order needs to be somewhat like what will be delivered using product function of score*fieldVal as effective score for sort order. But I don't need exact product for sorting. Approximations are ok, & this is just to roughly define the sort order I need.
I can see a few possible ways to accomplish this:
1. Use a customized function of score for
sort2. Use query time boost to increase the score using the int field value for boost
I'm new to Solr & don't understand the performance implications of each of above case. Also, don't know if there are other better ways to accomplish what I am trying to do. So how do I build performance friendly query to achieve this sort order ?
Have a look at solr function queries
http://wiki.apache.org/solr/FunctionQuery
Example: &sort=product(score, fieldVal)
来源:https://stackoverflow.com/questions/19193844/solr-sort-by-score-an-int-field-value