You probably don't have a field named "score". That said, the Solr error message is not very useful at all!

If you want to reference the document score, I don't think there is a direct way to do it, but you can indirectly by using the query function:

.../select?q=MacBook&sort=sum(base_score,query($q,0))+desc&wt=json&indent=true

-- Jack Krupansky

-----Original Message----- From: rachun
Sent: Wednesday, July 2, 2014 7:44 PM
To: solr-user@lucene.apache.org
Subject: Re: Customise score

Hi Jack,

I tried as you suggest

.../select?q=MacBook&sort=sum(base_score,score)+desc&wt=json&indent=true

but it didn't work and I got this error message

"error":{
   "msg":"sort param could not be parsed as a query, and is not a field
that exists in the index: sum(base_score,score)",
   "code":400}}

so, when I try something like this

.../select?q=MacBook&sort=sum(base_score,base_score)+desc&wt=json&indent=true

it works fine.
How to archive this, any idea?

Best Regards,
Chun





--
View this message in context: http://lucene.472066.n3.nabble.com/Customise-score-tp4145214p4145322.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to