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.

Intervals must begin with either '(' or '[', be followed by the start value, then a comma (','), the end value, and<br />

finally a closing ')' or ']’.<br />

For example:<br />

(1,10) -> will include values greater than 1 and lower than 10<br />

[1,10) -> will include values greater or equal to 1 and lower than 10<br />

[1,10] -> will include values greater or equal to 1 and lower or equal to 10<br />

The initial and end values cannot be empty. If the interval needs to be unbounded, the special character '*'<br />

can be used for both, start and end limit. When using '*', '(' and '[', and ')' and ']' will be treated equal. [*,*] will<br />

include all documents with a value in the field. The interval limits may be strings but there is no need to add<br />

quotes. All the text until the comma will be treated as the start limit, and the text after that will be the end limit.<br />

For example: [Buenos Aires,New York]. Keep in mind that a string-like comparison will be done to match<br />

documents in string intervals (case-sensitive). The comparator can't be changed.<br />

Commas, brackets and square brackets can be escaped by using '\' in front of them. Whitespaces before and<br />

after the values will be omitted. The start limit can't be grater than the end limit. Equal limits are allowed, this<br />

allows you to indicate the specific values that you want to count, like [A,A], [B,B] and [C,Z].<br />

Interval faceting supports output key replacement described below. Output keys can be replaced in both the f<br />

acet.interval parameter and in the facet.interval.set parameter. For example:<br />

&facet.interval={!key=popularity}some_field<br />

&facet.interval.set={!key=bad}[0,5]<br />

&facet.interval.set={!key=good}[5,*]<br />

&facet=true<br />

Local Parameters for Faceting<br />

The LocalParams syntax allows overriding global settings. It can also provide a method of adding metadata to<br />

other parameter values, much like XML attributes.<br />

Tagging and Excluding Filters<br />

You can tag specific filters and exclude those filters when faceting. This is useful when doing multi-select<br />

faceting.<br />

Consider the following example query with faceting:<br />

q=mainquery&fq=status:public&fq=doctype:pdf&facet=true&facet.field=doctyp<br />

e<br />

Because everything is already constrained by the filter doctype:pdf, the facet.field=doctype facet<br />

command is currently redundant and will return 0 counts for everything except doctype:pdf.<br />

To implement a multi-select facet for doctype, a GUI may want to still display the other doctype values and<br />

their associated counts, as if the doctype:pdf constraint had not yet been applied. For example:<br />

=== Document Type ===<br />

[ ] Word (42)<br />

[x] PDF (96)<br />

[ ] Excel(11)<br />

[ ] HTML (63)<br />

To return counts for doctype values that are currently not selected, tag filters that directly constrain doctype,<br />

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

310

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

Saved successfully!

Ooh no, something went wrong!