You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2009/12/12 23:11:53 UTC
[Solr Wiki] Update of "CommonQueryParameters" by GrantIngersoll
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "CommonQueryParameters" page has been changed by GrantIngersoll.
http://wiki.apache.org/solr/CommonQueryParameters?action=diff&rev1=25&rev2=26
--------------------------------------------------
||`score desc`||sort from highest score to lowest score||
||`price asc`||sort in ascending order of the "price" field||
||`inStock desc, price asc`||sort by "inStock" descending, then "price" ascending||
+ ||`sum(x_td, y_td) desc`|| sort by the sum of the values of x_td and y_td in a descending order||
Sorting can be done on the "score" of the document, or on any {{{multiValued="false" indexed="true"}}} field provided that field is either non-tokenized (ie: has no Analyzer) or uses an Analyzer that only produces a single Term (ie: uses the !KeywordTokenizer)
+
+ As of [[Solr1.5]], sorting can also be done by any single-valued function (as in FunctionQuery).
The common situation for sorting on a field that you do want to be tokenized for searching is to use a {{{<copyField>}}} to clone your field. Sort on one, search on the other.