You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by "Hoss Man (Confluence)" <co...@apache.org> on 2013/07/16 20:19:00 UTC

[CONF] Apache Solr Reference Guide > Query Screen

Space: Apache Solr Reference Guide (https://cwiki.apache.org/confluence/display/solr)
Page: Query Screen (https://cwiki.apache.org/confluence/display/solr/Query+Screen)

Change Comment:
---------------------------------------------------------------------
SOLR-4719 - json in ui by default

Edited by Hoss Man:
---------------------------------------------------------------------
You can use *Query*, shown under the name of each core, to submit a search query to a Solr server and analyze the results. In the example in the screenshot, a query has been submitted, and the screen shows the query results sent to the browser as JSON. 

!query-top.png|border=1,align=right,hspace=10! The query was sent to a core named "collection1". We used Solr's default query for this screen (as defined in {{solrconfig.xml}}), which is {{\*:\*}}. This query will find all records in the index for this core. We kept the other defaults, but the table below explains these options, which are also covered in detail in later parts of this Guide.

The response is shown to the right of the form. Requests to Solr are simply HTTP requests, and the query submitted is shown in light type above the results; if you click on this it will open a new browser window with just this request and response (without the rest of the Solr Admin UI). The rest of the response is shown in JSON, which is part of the request (see the {{wt=json}} part at the end). 

The response has at least two sections, but may have several more depending on the options chosen. The two sections it always has are the {{responseHeader}} and the {{response}}. The {{responseHeader}} includes the status of the search ({{status}}), the processing time ({{QTime}}), and the parameters ({{params}}) that were used to process the query.

The {{response}} includes the documents that matched the query, in {{doc}} sub-sections. The fields return depend on the parameters of the query (and the defaults of the request handler used). The number of results is also included in this section.

This screen allows you to experiment with different query options, and inspect how your documents were indexed. The query parameters available on the form are some basic options that most users want to have available, but there are dozens more available which could be simply added to the basic request by hand (if opened in a browser). The table below explains the parameters available:

|| Field || Description ||
| Request-handler | Specifies the query handler for the request. If a query handler is not specified, Solr processes the response with the standard query handler. |
| q | The query event. See [Searching] for an explanation of this parameter. |
| fq | The filter query.  See [Common Query Parameters] for more information on this parameter. |
| sort | Sorts the response to a query in either ascending or descending order based on the response's score or another specified characteristic. |
| start, rows | {{start}} is the offset into the query result starting at which documents should be returned. The default value is 0, meaning that the query should return results starting with the first document that matches. This field accepts the same syntax as the start query parameter, which is described in [Searching]. {{rows}} is the number of rows to return. |
| fl | Defines the fields to return for each document. You can explicitly list the stored fields you want to have returned by separating them with either a comma or a space. In Solr 4, the results of functions can also be included in the {{fl}} list. |
| wt | Specifies the Response Writer to be used to format the query response. Defaults to XML if not specified. |
| indent | Click this button to request that the Response Writer use indentation to make the responses more readable. |
| debugQuery | Click this button to augment the query response with debugging information, including "explain info" for each document returned. This debugging information is intended to be intelligible to the administrator or programmer. |
| dismax | Click this button to enable the Dismax query parser. See [The DisMax Query Parser] for further information. |
| edismax | Click this button to enable the Extended query parser.  See [The Extended DisMax Query Parser] for further information. |
| hl | Click this button to enable highlighting in the query response.  See [Highlighting] for more information. |
| facet | Enables faceting, the arrangement of search results into categories based on indexed terms. See [Faceting] for more information. |
| spatial | Click to enable using location data for use in spatial or geospatial searches. See [solr:Spatial Search] for more information. |
| spellcheck | Click this button to enable the Spellchecker, which provides inline query suggestions based on other, similar, terms. See [Spell Checking] for more information. |

h2. Related Topics

* [solr:Searching]

{scrollbar}


Stop watching space: https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=solr
Change email notification preferences: https://cwiki.apache.org/confluence/users/editmyemailsettings.action