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 2007/04/30 00:33:47 UTC

[Solr Wiki] Update of "CommonQueryParameters" by ryan

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ryan:
http://wiki.apache.org/solr/CommonQueryParameters

The comment on the change is:
adding sort parameter

------------------------------------------------------------------------------
- The following list of parameters are supported by both the DisMaxRequestHandler and the StandardRequestHandler.  Although they are not mandatory, it is strongly encouraged that all Future !SolrRequestHandlers support them as well.  [http://incubator.apache.org/solr/docs/api/org/apache/solr/util/SolrPluginUtils.html Some Utilities] exist to make implementing them easy.
+ The following list of parameters are supported by both the DisMaxRequestHandler and the StandardRequestHandler.  Although they are not mandatory, it is strongly encouraged that all Future !SolrRequestHandlers support them as well.  [http://lucene.apache.org/solr/api/org/apache/solr/util/SolrPluginUtils.html Some Utilities] exist to make implementing them easy.
  
  [[TableOfContents]]
  
+ == sort ==
+ 
+ Handlers that support sorting including DisMaxRequestHandler and the StandardRequestHandler use a common parameter "sort"
+ 
+ ||||'''Examples'''||
+ ||'''sort'''||'''Meaning'''||
+ || ||by defulat, it will sort by "score" ||
+ ||score || same as default||
+ ||price desc||sort in descending order of the "price" field||
+ ||inStock desc, price asc||sort by "inStock" descending, then "price" ascending||
+ 
+ Sorting can be done on any field that is indexed and non-tokenized, or on the document "score".
+ 
+ Other then the optional sort specification the only difference between how this query string is parsed, and how the Lucene !QueryParser works, is that by default, the Solr !QueryParser uses constant score variations of Range and Prefix queries by default, so you don't need to worry about the dreaded "Too Many Clauses" exception.  Open-ended range queries are also supported by using "*" as an end-point.
  
  == start ==