Faceted Navigation Performance and Troubleshooting

Faceted navigation in Bloomreach Content can deliver high performance when configured correctly. This page outlines common performance issues, their causes, and recommended solutions.

Large Result Sets Without a hippofacnav:limit

If you do not configure a hippofacnav:limit and your result sets are large, performance will degrade. For example, if you have 1,000,000 documents and 250,000 of them match a particular facet (such as documents from the current year), the result set will contain 250,000 child nodes. Processing such a large number of nodes is resource-intensive.

To avoid this, always set a global limit on the result set using the hippofacnav:limit property. For example, if you want to display up to 10 pages with 10 documents per page, set the limit to 100. You can still retrieve the total count of matching documents from the parent node. By default, the result set is limited to 1,000 documents.

Set a limit on the result set:

hippofacnav:limit: 50

Excessive Number of Unique Facet Values

If a facet has a very high number of unique values, performance will suffer. For example, if you use a timestamp field as a facet (myproject:date) and have 1,000,000 unique timestamps, the system will create 1,000,000 subfolders. This consumes significant memory and CPU resources. Using a timestamp as a facet is generally not meaningful.

For date fields, use hierarchical facets such as myproject:date$year or myproject:date$month to reduce the number of unique facet values. For other fields, such as myproject:author with 10,000 unique authors, limit the number of facet values shown. Use the hippofacnav:facetnodenames configuration to display only the most common values.

To show the 10 most common authors:

author${sortby:'count', sortorder:'descending', limit:10}

Retrieving All Documents in the Result Set on the Frontend

Fetching the entire result set when only a subset is needed (such as the first page of results) is inefficient. You should only retrieve the documents required for display. Sorting should be handled on the faceted navigation node, not on the client side.

For HST2 implementations, avoid the following inefficient code:

Wrong:

//Do not use, also see API List<HippoBeanDocument> results = facetNav.getResultSet().getDocuments() //Do not use, also see API List<HippoBeanDocument> results = facetNav.getResultSet().getDocuments(0, 10)

Instead, use a lazy-loading iterator to fetch only the required documents:

Correct:

List<ProductBean> resultset = new ArrayList<ProductBean>(); HippoDocumentIterator<ProductBean> it = facetNav.getResultSet().getDocumentIterator(ProductBean.class); int skip = 0; it.skip(skip); while(it.hasNext() && it.getPosition() < 10 + (skip - 1)) { resultset.add(it.next()); }

HippoDocumentIterator loads only the documents you need, improving performance.

Range Queries on Dates with Large Data Sets

Range queries on date fields are CPU-intensive in Jackrabbit. Combining an XPath range query with faceted navigation can result in slow performance. If possible, use the "Ranges faceted navigation" feature instead, which is optimized for performance. Alternatively, follow the guidance in Fast and Scalable Date Range Searches with Hippo Repository to implement efficient date range queries.

Unnecessary Traversal of the Faceted Navigation Tree

Traversing more nodes in the faceted navigation tree than necessary reduces performance. Ensure your code only accesses the nodes required for your use case.

Unnecessary Population of hippo:resultset for Certain Node Types

In many scenarios, you do not need to populate the hippo:resultset for hippofacnav:facetnavigation or hippofacnav:facetsavailablenavigation nodes. For example, most implementations do not require a result set on hippofacnav:facetsavailablenavigation nodes. Performance improves if you skip generating the result set where it is not needed.

To skip the result set for the root hippofacnav:facetnavigation node, add the following boolean property:

hippofacnav:skipresultsetfacetnavigationroot: true

To skip the result set for the hippofacnav:facetsavailablenavigation node, add this boolean property:

hippofacnav:skipresultsetfacetsavailable: true
Share Feedback
Page: /build/search/faceted-navigation/faceted-navigation-performance--troubleshooting
Section: Build
Category *