Facet

The Facets form field provides a list of facet values for a particular field indexed in Solr.

  • type (mandatory) must be JSolr.Facet,

  • name (mandatory) is the unique name of the facet. It is used as an alias for the actual facet field as defined by the facet parameter,

  • facet (mandatory) is the name of the Solr Index facet field,

  • filter (mandatory) is the name of the Solr Index field to use for filtering the search results when one or more facet values are selected,

  • label (optional) (translatable) is the descriptive title of the facet,

  • class (optional) is one or more CSS classes to apply to the facet layout.

  • showcount (optional) specifies whether the facet count should be shown. Use true to show the count or false otherwise. The default is to not show the count,

  • sort (optional) specifies in what order the facets should be shown. The two options are count and index. The default is count,

  • mincount (optional) specifies the minimum count a facet must have in order to be included in the list. Must be a value greater than or equal to 0,

  • limit (optional) is the maximum number of facet values to show. The default is to show all.

  • ignorefilter (optional) ignores the filters applied to the facet so that the original list of facets are displayed. Setting to true will ignore the applied filter, false will apply the filter. The default is false.

Example

<field
    name="author"
    facet="author"
    filter="author"
    type="jsolr.facets"
    label="Limit by Author"
    class="inputbox jsolrquery"
    showcount="true"
    sort="count"
    mincount="1"
    limit="5"
    ignorefilter="true"/>