Solr Differences Between Solr And Lucene Parser

The standard Solr Query Parser syntax is a superset of the Lucene Query Parser syntax.

Range queries [a TO z], prefix queries a*, and wildcard queries a*b are constant-scoring (all matching documents get an equal score). The scoring factors tf, idf, index boost, and coord are not used. There is no limitation on the number of terms that match (as there was in past versions of Lucene).

Lucene 2.1 has also switched to use ConstantScoreRangeQuery for its range queries.

A * may be used for either or both endpoints to specify an open-ended range query. field:[* TO 100] finds all field values less than or equal to 100. field:[100 TO *] finds all field values greater than or equal to 100. field:[* TO *] matches all documents with the field.

Pure negative queries (all clauses prohibited) are allowed. -inStock:false finds all field values where inStock is not false. -field:[* TO *] finds all documents without a value for field

A hook into FunctionQuery syntax. Quotes will be necessary to encapsulate the function when it includes parentheses.

Nested query support for any type of query parser (via QParserPlugin). Quotes will often be necessary to encapsulate the nested query if it contains reserved characters.

The dismax query parser provides query time field level boosting granularity, with less special syntax. Dismax generally makes the best first choice query parser for user facing Solr applications. The dismax handler parameters are described in detail here: DisMaxRequestHandler.

For a full list of available parser types, see the all subclasses of QParserPlugin

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License