Skip to main content

Description

The facet directive displays an individual facet. Either a response object and facet name must be passed to it, or a facet object.

Search Within Facet

To enable search within facets the following attributes must be set on the facet search-enabled="true". The following attributes can be set on either the facet-list tag or the facet tag to enable search within platform and query. If using a string field such as facet_field_s then you should add the attribute facet-field to your facet tag with the tokenized version of that field eg. facet-field="facet_field_t", for more information see the search-enabled and facet-field attributes.

Multi-term facet queries

A field named location_facet might have several facets, such as ‘AGL Centre’, ‘Airport City’, and ‘Airport Road’. When you search for ‘AGL c’, you want to see ‘AGL Centre’ in the results. When conducting partial searches on multi-term facets, tokenize the searched field using solr.KeywordTokenizerFactory. Lower-case transformation is crucial for case-insensitive matching. You can use the built-in lowercase field type in Fusion:
This applies a tokenizer and a lower-case filter to get partial and case-insensitive string matches when searching within facets.

Usage

as element:

Directive info

  • This directive creates new scope.

Parameters

Example

Source

Result

Result