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 2006/02/27 17:34:17 UTC

[Solr Wiki] Update of "StandardRequestHandler" by YonikSeeley

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 YonikSeeley:
http://wiki.apache.org/solr/StandardRequestHandler

------------------------------------------------------------------------------
- The [http://incubator.apache.org/solr/docs/api/ Standard Request Handler] is the default Query handler included in the standard Solr distribution.  It is usually registered in the solrconfig.xml with the query type "standard", and while it's certianly possible to reconfigure Solr so that a different handler is registered with that query type -- it is discouraged.  (Doing so would most likely confuse a great many people)
+ The Standard Request Handler is the default Query handler included in the standard Solr distribution.  It is usually registered in the solrconfig.xml with the query type "standard", and while it's certainly possible to reconfigure Solr so that a different handler is registered with that query type -- it is discouraged.  (Doing so would confuse a great many people)
  
  = Query Params =
  
@@ -8, +8 @@

  
  == q ==
  
- This is the only mandatory query parameter.  It must be a query parsable according to the [http://lucene.apache.org/java/docs/queryparsersyntax.html Lucene Query Parser Syntax], followed by an optional sort specification.  Examples:
+ This is the only mandatory query parameter.  It must be a query specified in SolrQuerySyntax, currently a Lucene query ([http://lucene.apache.org/java/docs/queryparsersyntax.html Lucene Query Parser Syntax]), followed by an optional sort specification.  Examples:
  
  ||||'''Examples'''||
  ||'''Query String'''||'''Meaning'''||
  ||`lucene`||search for "lucene" in the default field||
  ||`name:solr`||search for "solr" in the "name" field||
  ||`name:solr; price desc`||same as above, but in descending order of the "price" field||
- ||`name:solr; inStock desc price asc`||same as above, but sorted by "inStock" descending, then "price" ascending||
+ ||`name:solr; inStock desc, price asc`||same as above, but sorted by "inStock" descending, then "price" ascending||
  
- Other then the optional sort specification the only difference between how this query string is parsed, and hose 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.
+ Other then the optional sort specification the only difference between how this query string is parsed, and hose 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 ==
  
  This paramater is used to paginate results from a query.  When specified, it indicates the offset in the complete result set for the queries where the set of returned documents should begin. 
@@ -27, +26 @@

  
  == rows ==
  
- This paramater is used to paginate results from a query.  When specified, it indicates the maximum number of documents from the complete result set to return to the client.
+ This parameter is used to paginate results from a query.  When specified, it indicates the maximum number of documents from the complete result set to return to the client.
  
  The default value is "`10`"
  
@@ -35, +34 @@

  
  This parameter can be used to specify a set of fields to use to limit the amount of information in the response.  When returning the results to the client, only fields in this list will be included.
  
- This list can be specified as a space (or comma) seperated list of field names.  The string "`score`" can be used to indicate that the score of each document should be returned as a field, and the string "`*`" can be used to indicate all (real) fields the document has.
+ This list can be specified as a space (or comma) separated list of field names.  The string "`score`" can be used to indicate that the score of each document for the particular query should be returned as a field, and the string "`*`" can be used to indicate all stored fields the document has.
  
  
  ||||'''Examples'''||
@@ -47, +46 @@

  ||`*`||Return any fields the documents have||
  ||`* score`||Return any fields the document has, along with the score||
  
- /!\ :TODO: /!\ whoa ... if you specify "score" it return all fields plus score ... is that the expected behavior?
  
  The default value is "`*`"
  
  == debugQuery ==
  
- If this parameter is present (regardless of it's value) then additional debugging information will be included in the response, including "explain" info for each of the documents returned.
+ If this parameter is present (regardless of it's value) then additional debugging information will be included in the response, including "explain" info for each of the documents returned.  This debugging info is meant for human consumption... it's XML format could change in the future.
  
  The default behavior is not to include debugging info.
  
@@ -61, +59 @@

  
  This parameter allows clients to specify a Lucene query to identify a set of documents.  If non-blank, the explain info of each document which matches this query, relative the ''main query'' (specified by the q parameter) will be returned along with the rest of the debugging information.
  
- The default value is blank (ie: no extra explain info will be returned)
+ The default value is blank (i.e. no extra explain info will be returned)
  
  = Response =
  
- By default, the response from the Standard Query Handler contains one `<result>` block, which is unamed.  If the `debugQuery` parameter is used, then an additional `<lst>` block will be returned, using the name "debug".  This will contain some usefull debuging info, including the orriginal query string, the parsed query string, and explain info for each document in the `<result>` block.  If the `explainOther` parameter is also used, then additional explain info will be provided for all of documents matching that query.
+ By default, the response from the Standard Query Handler contains one `<result>` block, which is un unnamed.  If the `debugQuery` parameter is used, then an additional `<lst>` block will be returned, using the name "debug".  This will contain some useful debugging info, including the original query string, the parsed query string, and explain info for each document in the `<result>` block.  If the `explainOther` parameter is also used, then additional explain info will be provided for all of documents matching that query.
  
  == Sample Responses ==
  
@@ -73, +71 @@

  
  === A simple query that returns one document ===
  
- `http://yourhost.tld:9999/solr/select?q=id%3ASP2514N&version=2.1&indent=1`
+ `http://yourhost.tld:9999/solr/select?q=id:SP2514N&version=2.1&indent=1`
  
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
@@ -100, +98 @@

  
  === A simple query for one document, with a limited field list ===
  
- `http://yourhost.tld:9999/solr/select?q=id%3ASP2514N&version=2.1&indent=1&fl=id+name`
+ `http://yourhost.tld:9999/solr/select?q=id:SP2514N&version=2.1&indent=1&fl=id+name`
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
  <response>
@@ -118, +116 @@

  
  === A limited number of fields, plus the scores of the first 2 documents in the result set ===
  
- `http://yourhost.tld:9999/solr/select?q=cat%3Aelectronics+Belkin&version=2.1&start=0&rows=2&indent=on&fl=id+name+score`
+ `http://yourhost.tld:9999/solr/select?q=cat:electronics+Belkin&version=2.1&start=0&rows=2&indent=on&fl=id+name+score`
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
  <response>
@@ -143, +141 @@

  
  === The third and Fourth documents in the result set ===
  
- `http://yourhost.tld:9999/solr/select?q=cat%3Aelectronics+Belkin&version=2.1&start=2&rows=2&indent=on&fl=id+name+score`
+ `http://yourhost.tld:9999/solr/select?q=cat:electronics+Belkin&version=2.1&start=2&rows=2&indent=on&fl=id+name+score`
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
  <response>
@@ -167, +165 @@

  
  === The second document in the result set with and debuging info (including it's score explanation) ===
  
- `http://yourhost.tld:9999/solr/select?q=cat%3Aelectronics+Belkin&version=2.1&start=1&rows=1&indent=on&fl=id+name+score&debugQuery=`
+ `http://yourhost.tld:9999/solr/select?q=cat:electronics+Belkin&version=2.1&start=1&rows=1&indent=on&fl=id+name+score&debugQuery=`
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
  <response>
@@ -212, +210 @@

  
  === One document in a result set, and the explain info for another document ===
  
- `http://localhost:8983/solr/select?q=cat%3Aelectronics+Belkin&version=2.1&start=1&rows=1&indent=on&fl=id+name+score&explainOther=id%3A6H500F0&debugQuery=`
+ `http://localhost:8983/solr/select?q=cat:electronics+Belkin&version=2.1&start=1&rows=1&indent=on&fl=id+name+score&explainOther=id%3A6H500F0&debugQuery=`
     {{{
  <?xml version="1.0" encoding="UTF-8"?>
  <response>