On Fri, Apr 15, 2011 at 11:50 AM, Michael Owen <michaelowe...@hotmail.com> wrote: > > Using solr 3.1. > When I do: > sort=score desc > it works. > sort=product(typeId,2) desc (typeId is a valid attribute in document) > it works. > sort=product(score,typeId) desc > fails on 400 error? Also "sort=product(score,2) desc" fails too.
You can't currently use "score" in function queries. You can embed another query in a function query though. Example: sort=product($qq,typeId) desc&qq=my_query_here In your case, when you just want to multiply the score by a field, then you can either use the edismax query parser and the "boost" parameter: defType=edismax&q=my_query_here&boost=typeId Or you could directly use the "boost" query parser http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin.html q={!boost b=typeId}my_query_here OR q={!boost b=typeId v=$qq}&qq=my_query_here -Yonik http://www.lucenerevolution.org -- Lucene/Solr User Conference, May 25-26, San Francisco