Question

Solr can show the query score of each documents by field 'score'. I have two special fileds, say A and B. How can I rank the results based on product of score, A and B. I try to use something like ?q=data&sort=product(score, A, B) desc but always get an error "Can't determine Sort Order: 'product(score, A, B) desc', pos=14"

Was it helpful?

Solution

Sorting on score is default. So you could boost this result by boosting on field A and B. Take a look at this: http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html (nearly) something like this, if you search for foo (not tested)

{!boost b=product(A,B)}foo 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top