11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

q=features:songs & fq=+filter(inStock:true) +filter(price:[* TO 100])<br />

q=manu:Apple & fq=-filter(inStock:true) -filter(price:[* TO 100])<br />

Range queries ("[a TO z]"), prefix queries ("a*"), and wildcard queries ("a*b") are constant-scoring (all<br />

matching documents get an equal score). The scoring factors TF, IDF, index boost, and "coord" are not<br />

used. There is no limitation on the number of terms that match (as there was in past versions of Lucene).<br />

Specifying Dates and Times<br />

Queries against fields using the TrieDateField type (typically range queries) should use the appropriate date<br />

syntax:<br />

timestamp:[* TO NOW]<br />

createdate:[1976-03-06T23:59:59.999Z TO *]<br />

createdate:[1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]<br />

pubdate:[NOW-1YEAR/DAY TO NOW/DAY+1DAY]<br />

createdate:[1976-03-06T23:59:59.999Z TO 1976-03-06T23:59:59.999Z+1YEAR]<br />

createdate:[1976-03-06T23:59:59.999Z/YEAR TO 1976-03-06T23:59:59.999Z]<br />

Related Topics<br />

Local Parameters in Queries<br />

Other Parsers<br />

The DisMax Query Parser<br />

The DisMax query parser is designed to process simple phrases (without complex syntax) entered by users and<br />

to search for individual terms across several fields using different weighting (boosts) based on the significance of<br />

each field. Additional options enable users to influence the score based on rules specific to each use case<br />

(independent of user input).<br />

In general, the DisMax query parser's interface is more like that of Google than the interface of the 'standard' <strong>Solr</strong><br />

request handler. This similarity makes DisMax the appropriate query parser for many consumer applications. It<br />

accepts a simple syntax, and it rarely produces error messages.<br />

The DisMax query parser supports an extremely simplified subset of the Lucene QueryParser syntax. As in<br />

Lucene, quotes can be used to group phrases, and +/- can be used to denote mandatory and optional clauses.<br />

All other Lucene query parser special characters (except AND and OR) are escaped to simplify the user<br />

experience. The DisMax query parser takes responsibility for building a good query from the user's input using<br />

Boolean clauses containing DisMax queries across fields and boosts specified by the user. It also lets the <strong>Solr</strong><br />

administrator provide additional boosting queries, boosting functions, and filtering queries to artificially affect the<br />

outcome of all searches. These options can all be specified as default parameters for the handler in the solrco<br />

nfig.xml file or overridden in the <strong>Solr</strong> query URL.<br />

Interested in the technical concept behind the DisMax name? DisMax stands for Maximum Disjunction. Here's a<br />

definition of a Maximum Disjunction or "DisMax" query:<br />

A query that generates the union of documents produced by its subqueries, and that scores each<br />

document with the maximum score for that document as produced by any subquery, plus a tie<br />

breaking increment for any additional matching subqueries.<br />

Whether or not you remember this explanation, do remember that the DisMax request handler was primarily<br />

designed to be easy to use and to accept almost any input without returning an error.<br />

DisMax Parameters<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

260

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!