: I want to rank the search result by the function: : relevance_score*numberic_field/(relevance_score +numberic_field ) , this : function equals to : : 1/((1/relevance_score)+1/numberic_field)
your email seems to asks 2 differnet questions: 1) "sort by the function ...(containing the relevancy score)" 2) "rank (ie: score) the search result by the function" You can do 1 or hte other or both -- but it's important to understand the differnce... 1) you can structure your "main" query such that the *score* produced for each document is computed by a function where an input to that function is the result of a "sub query" This might be something like... ?q={!boost f=numberic_field v=$qq} &qq={!edismax ....} ...this will affect the value of the "score" returned for each document, as well as the behavior if you sort by "score" Because i used the "boost" parser explicitly in this example, the function doesn't affect which documents match, it just computes the scores of the documents matching the subquery by multipling their originla score by the function. 2) independent of your main query, you can sort by an arbitrary function, where an input to that function is the result of some query. This might be something like your specific example... ?q=...whatever you want... sort=div(1,sum(div(1,field(numberic_field)),div(1,$qq) desc qq={!edismax ...} ...this will affect the order that documents are returned, but won't affect the "score" returned with each document. It also won't affect which documents match, it just computes an independent numeric value for sorting hte documents that already match. 3) you can combine #1 and #2 if you want to -- they can be based on different relevancy queries, or even the exact same relevancy query using variable replacement if that's what you want -- but you can't refer to "score" as the input of a function query because it doesn't know which "score" you want to use (you could have lots of different queries with differnet scores being computed as part of the request)... -Hoss