A query parser parses a string into an internal Lucene query object, potentially considering request parameters and so-called local-params. Only a few parsers actually do real string parsing; some parsers—like those for geospatial—don't even use the query string. The default query parser is named lucene
, and it has a special leading syntax to switch the parser to another and/or to specify parameters. Here's an example using the dismax
parser along with two local-params and a query string of billy corgan
:
{!dismax qf="a_name^2 a_alias" tie=0.1}billy corgan
Note
It's not common to see this syntax in the user query, q
, since its parser is conveniently set via defType
.
There are a few things to know about the local-params syntax:
The leading query parser name (for example, DisMax) is optional. Without it, the parser remains as lucene. Furthermore, this syntax is a shortcut to put the query parser name in the
type
local-param.Usually, a query parser treats local-params...