Configure Faceted Tree Filters

Overview

This page explains how to configure filters for faceted trees in Bloomreach Content.

When to Use

Add filters to a faceted tree to control which documents appear in the result set.

Prerequisites

Filter Configuration

Filters are set on any hippofacnav:facetnavigation node using the multi-valued String property hippofacnav:filters. All filters are combined using logical AND.

Supported filter formats:

  • jcr:primaryType = nodeType
  • propertyname = propertyvalue
  • propertyname != propertyvalue
  • contains(., text)
  • contains(propertyname, text)
  • not(expression)
  • text (interpreted as a free text query)

Examples

Filter by Node Type

To include only documents of type myproject:newsdocument in the faceted tree results:

hippofacnav:filters: [ 'jcr:primaryType = myproject:newsdocument' ]

Filter by Property Value

To include only documents where the property myproject:brand equals hippo:

hippofacnav:filters: [ 'myproject:brand = hippo' ]

To exclude documents where the property myproject:brand equals hippo:

hippofacnav:filters: [ 'myproject:brand != hippo' ]

Document-Scoped Free Text Query

Use free text queries to search any property of any descendant node. If no result set sorting is configured, results are ordered by Lucene scoring. The query syntax is based on the Lucene QueryParser syntax, with these exceptions:

Unsupported features:

  • Fuzzy searches
  • Proximity searches
  • Range queries
  • Wildcards at the start of a keyword

Examples:

Include documents containing the word jump:

hippofacnav:filters: [ 'contains(.,jumps)' ]

Include documents containing both quick and jump:

hippofacnav:filters: [ 'contains(.,quick jump)' ]

Include documents containing quick or jump:

hippofacnav:filters: [ 'contains(.,quick OR jump)' ]

Include documents containing the exact phrase brown fox jumps:

hippofacnav:filters: [ 'contains(.,"brown fox jumps")' ]

Include documents with words matching bro?n (where ? is any single character):

hippofacnav:filters: [ 'contains(.,bro?n)' ]

Include documents with words matching laz* (where * is any character sequence):

hippofacnav:filters: [ 'contains(., laz*)' ]

Boost the relevance of quick by a factor of 10 compared to jump:

hippofacnav:filters: [ 'contains(.,quick^10 OR jump)' ]

If you specify only text, it is treated as a contains(.,text) query. For example:

hippofacnav:filters: [ 'quick brown fox' ]

is equivalent to

hippofacnav:filters: [ 'contains(.,quick brown fox)' ]

To search within a specific property, use the property name in the contains function.

For example, to include documents where the myproject:title property contains hippo or onehippo:

hippofacnav:filters: [ 'contains(myproject:title, hippo OR onehippo)' ]

Negation

Negate any filter expression by wrapping it in not().

For example, to exclude documents where myproject:brand equals hippo:

hippofacnav:filters: [ 'not(myproject:brand = hippo)' ]

Verification

After configuring filters, verify that the faceted tree returns only the expected documents based on your filter criteria.

Share Feedback
Page: /build/search/faceted-navigation/configure-faceted-tree-filters
Section: Build
Category *
Configure Faceted Tree Filters | Bloomreach Content Documentation