Hi.  Where did you find such an obtuse example?

Recently, Solr supports sorting by function query.  One such function is
named "query" which takes a query and uses the score of the result of that
query as the function's result.  Due to constraints of where this query is
placed within a function query, it is necessary to use the local-params
syntax (e.g. {!v=...}) since you can't simply state "category:445".  Or,
there could have been a parameter dereference like $sortQ where sortQ is
another parameter holding category:445.  Any way, the net effect is that
documents are score-sorted based on the query category:445 instead of the
user-query ("q" param). I'd expect category:445 docs to come up top and all
others to appear randomly afterwards.  It would be nice if the sort query
could simply be "category:445 desc" but that's not supported.

Complicated?  You bet!  But fear not; this is about as complicated as it
gets.

References:
http://wiki.apache.org/solr/SolrQuerySyntax
http://wiki.apache.org/solr/CommonQueryParameters#sort
http://wiki.apache.org/solr/FunctionQuery#query

~ David Smiley
 Author: https://www.packtpub.com/solr-1-4-enterprise-search-server/book

-----
 Author: https://www.packtpub.com/solr-1-4-enterprise-search-server/book
--
View this message in context: 
http://lucene.472066.n3.nabble.com/noobie-question-sorting-tp2685250p2685617.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to