11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Re-Ranking Query Parser<br />

The ReRankQParserPlugin is a special purpose parser for Re-Ranking the top result of a simple query using<br />

a more complex ranking query.<br />

Details about using the ReRankQParserPlugin can be found in the Query Re-Ranking section.<br />

Simple Query Parser<br />

The Simple query parser in <strong>Solr</strong> is based on Lucene's SimpleQueryParser. This query parser is designed to<br />

allow users to enter queries however they want, and it will do its best to interpret the query and return results.<br />

This parser takes the following parameters:<br />

Parameter<br />

q.operators<br />

Description<br />

Enables specific operations for parsing. By default, all operations are enabled, and this can be<br />

used to disable specific operations as needed. Passing an empty string with this parameter<br />

disables all operations.<br />

Operator Description Example<br />

+ Specifies AND token1+token2<br />

| Specifies OR token1|token2<br />

- Specifies NOT -token3<br />

" Creates a phrase "term1 term2"<br />

* Specifies a prefix query term*<br />

~N At the end of terms, specifies a fuzzy query term~1<br />

~N At the end of phrases, specifies a NEAR query "term1<br />

term2"~5<br />

( ) Specifies precedence; tokens inside the parenthesis will be<br />

analyzed first. Otherwise, normal order is left to right.<br />

token1 +<br />

(token2 |<br />

token3)<br />

If needed, operators can be escaped with the \ character.<br />

q.op<br />

qf<br />

df<br />

Defines an operator to use by default if none are defined by the user. By default, OR is defined;<br />

an alternative option is AND.<br />

A list of query fields and boosts to use when building the query.<br />

Defines the default field if none is defined in the Schema, or overrides the default field if it is<br />

already defined.<br />

Any errors in syntax are ignored and the query parser will interpret as best it can. This can mean, however, odd<br />

results in some cases.<br />

Spatial Query Parsers<br />

There are two spatial QParsers in <strong>Solr</strong>: geofilt and bbox.<br />

But there are other ways to query spatially: using<br />

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

291

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

Saved successfully!

Ooh no, something went wrong!