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.

<br />

<br />

TermsQueryBuilder<br />

UserInputQueryBuilder<br />

LegacyNumericRangeQuery(Builder) is deprecated<br />

Faceting<br />

As described in the section Overview of Searching in <strong>Solr</strong>, faceting is the arrangement of search results into<br />

categories based on indexed terms. Searchers are presented with the indexed terms, along with numerical<br />

counts of how many matching documents were found were each term. Faceting makes it easy for users to<br />

explore search results, narrowing in on exactly the results they are looking for.<br />

Topics covered in this section:<br />

General Parameters<br />

Field-Value Faceting Parameters<br />

Range Faceting<br />

Pivot (Decision Tree) Faceting<br />

Interval Faceting<br />

Local Parameters for Faceting<br />

Related Topics<br />

General Parameters<br />

The table below summarizes the general parameters for controlling faceting.<br />

Parameter<br />

facet<br />

facet.query<br />

Description<br />

If set to true, enables faceting.<br />

Specifies a Lucene query to generate a facet count.<br />

These parameters are described in the sections below.<br />

The facet Parameter<br />

If set to "true," this parameter enables facet counts in the query response. If set to "false" to a blank or<br />

missing value, this parameter disables faceting. None of the other parameters listed below will have any<br />

effect unless this parameter is set to "true." The default value is blank.<br />

The facet.query Parameter<br />

This parameter allows you to specify an arbitrary query in the Lucene default syntax to generate a facet<br />

count. By default, <strong>Solr</strong>'s faceting feature automatically determines the unique terms for a field and returns a<br />

count for each of those terms. Using facet.query, you can override this default behavior and select exactly<br />

which terms or expressions you would like to see counted. In a typical implementation of faceting, you will<br />

specify a number of facet.query parameters. This parameter can be particularly useful for<br />

numeric-range-based facets or prefix-based facets.<br />

You can set the facet.query parameter multiple times to indicate that multiple queries should be used as<br />

separate facet constraints.<br />

To use facet queries in a syntax other than the default syntax, prefix the facet query with the name of the<br />

query notation. For example, to use the hypothetical myfunc query parser, you could set the facet.query<br />

parameter like so:<br />

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

295

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

Saved successfully!

Ooh no, something went wrong!