In my project, I got a similar problem likes
http://stackoverflow.com/questions/27701533/using-functionquery-in-solr-sort-syntax
I want to sort my documents by a custom score using function sort=div(product(field(score),credit),distance) asc Error:
"error": {
"msg": "sort param could not be parsed as a query, and is not a field that exists in the index: div(product(field(score),credit),distance)",
"code": 400
}
The reason is 'score' is a pseudo field.
The alternative way is appending a _val_ which is a hook provided by Solr for FunctionQuery.
The query parameter 'q' likes
我要一份牛肉面 AND _val_:"product(scale(credit,1,10),recip(geodist(),3,1,0.1))"