Pivot facets enable Solr to return facet counts across sets of fields. This means that the facet results are multi-level, where each level is a different Solr field. Pivot facets are great for hierarchical or tree faceting.
Pivot faceting is simple to use. The feature itself introduces only two new parameters:
facet.pivot
: This field is similar tofacet.field
, but instead of giving it a single field, it expects an ordered comma-delimited list of fields. Each field is recursively faceted from the field listed before it in the list.facet.pivot.mincount
: This is similar tofacet.mincount
, but only for pivot facets. The default value is 1.
It's important to know that the facet.pivot
parameter only accepts field names. It won't handle functions, for example. Additionally, the facet.pivot
parameter can be specified multiple times.
Time for an example! Let's query the mbtracks core to show artist name, release name...