Solr’s namespaces

I have to admit, moving from Lucene (3.2) to Solr (3.5) has been very painful. The parameter namespaces are so incredibly cognitively taxing (qf,fq,fl,{!tag=..},…), colorfully said to be more of a communication language than programming language. After painfully mapping all the acronyms to memory the next problem is to map the SolrJ client namespace for the same URL parameter namespace. And method names like this really don’t help.

setGetFieldStatistics(boolean v) 

For the benefit of those Solr noobies here is (an incomplete) list I gathered (mainly from Lucidworks) of the parameter namespaces. Found this very useful process pipeline flow from LucidWorks

Flow from LucidWorks

“Common Query” Parameters

The table below summarizes Solr’s common query parameters, which are supported by the Standard, DisMax, and eDisMax Request Handlers. Lucid Imagination strongly recommends that any future SolrRequestHandlers support these parameters, as well.

Parameter Description
defType Selects the query parser to be used to process the query.
sort Sorts the response to a query in either ascending or descending order based on the response’s score or another specified characteristic.
start  Specifies an offset (by default, 0) into the responses at which Solr should begin displaying content.
rows  Controls how many rows of responses are displayed at a time (default value: 10)
fq  Applies a filter query to the search results.
fl  Limits the query’s responses to a listed set of fields.
debugQuery Causes Solr to include additional debugging information in the response, including “explain” information for each of the documents returned. Note that this parameter takes effect if it is present, regardless of its setting.
explainOther 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 to the main query (specified by the q parameter) will be returned along with the rest of the debugging information.
timeAllowed Defines the time allowed for the query to be processed. If the time elapses before the query response is complete, partial information may be returned.
omitHeader Excludes the header from the returned results, if set to true. The header contains information about the request, such as the time the request took to complete. The default is false.
wt Specifies the Response Writer to be used to format the query response.
cache=false By default, Solr caches the results of all queries and filter queries. Set cache=false to disable caching of the results of a query.

DisMax Parameters

In addition to the common request parameter, highlighting parameters, and simple facet parameters, the DisMax query parser supports the parameters described below. Like the standard query parser, the DisMax query parser allows default parameter values to be specified in solrconfig.xml, or overridden by query-time values in the request.

Parameter Description
q  Defines the raw input strings for the query.
q.alt Calls the standard query parser and defines query input strings, when the q parameter is not used.
qf Query Fields: specifies the fields in the index on which to perform the query.
mm Minimum “Should” Match: specifies a minimum number of fields that must match in a query.
pf  Phrase Fields: boosts the score of documents in cases where all of the terms in the q parameter appear in close proximity.

ps Phrase Slop: specifies the number of positions two terms can be apart in order to match the specified phrase.

qs Query Phrase Slop: specifies the number of positions two terms can be apart in order to match the specified phrase. Used specifically with the qf parameter.

tie Tie Breaker: specifies a float value (which should be something much less than 1) to use as tiebreaker in DisMax queries.

bq Boost Query: specifies a factor by which a term or phrase should be “boosted” in importance when considering a match.

bf Boost Functions: specifies functions to be applied to boosts. (See for details about function queries.)