Apache Solr 6 Faceting , Facet Range Queries on two fields, sorting in a field

Опубликовано: 16 Октябрь 2024
на канале: Learn Technology
18,928
100

faceting is the arrangement of search results into categories based on indexed terms. Searchers are presented with the indexed terms, along with numerical counts of how many matching documents were found were each term. Faceting makes it easy for users to explore search results, narrowing in on exactly the results they are looking for.
Facet by Range:
use the Range Faceting feature on any date field or any numeric field that supports range queries. This is particularly useful for the cases in the past where one might stitch together a series of range queries (as facet by query) for things like prices, etc.

facet.range

This param indicates what field to create range facets for. This param allows you to specify names of fields which should be treated as range facets.

Example: facet.range=price&facet.range=age

facet.range.start

The lower bound of the ranges.

This parameter can be specified on a per field basis.

Example: f.price.facet.range.start=0.0&f.age.facet.range.start=10

facet.range.end

The upper bound of the ranges.

This parameter can be specified on a per field basis.

Example: f.price.facet.range.end=1000.0&f.age.facet.range.start=99

facet.range.gap

The size of each range expressed as a value to be added to the lower bound. For date fields, this should be expressed using the DateMathParser syntax. (ie: facet.range.gap=%2B1DAY, decoded = "+1DAY", URL encoding uses a normal plus sign as a space, so passing a plus to Solr request URL Hex encoding as %2B )