: I'm using the solr 4.0 nightly build version. In fact I intend to sort with : a more complicate function including score, geodist() and other factors, so : this example is to simplify the issue that I cannot sort with a customized : function of score. : More concrete, how can i make the sort like: : sort=product(div(1,geodist()),score) desc ?
in order to include a "score" of a query in a function (any function, regardless of where/how you are using that function -- in this case in a "sort") you need to be explict about the query whose score you want to use via the "query()" function. So something like this would probably do what you want... q=whatever_your_query_is&sort=product(div(1,geodist()),query($q))+desc ...but i believe it would be more efficient as ... qq=whatever_your_query_is&q={!boost+b=div(1,geodist())+v=$qq}&sort=score+desc -Hoss