Goal
How can I use hierarchical facet fields in Fusion 5 to support nested filtering in Predictive Merchandiser, including data transformation steps, indexing format, and facet query syntax?
Environment
Fusion 5.9.12
Self-hosted on Amazon EKS
Data indexed using SharePoint connector
Facets tested in Predictive Merchandiser
Guide
Prepare hierarchical data using delimited levels
To enable hierarchical facets in Predictive Merchandiser, facet field values must be indexed using a structured, depth-prefixed format. This format requires:
A multi-valued field
Level-indicating numeric prefixes (0, 1, 2, etc.)
A consistent delimiter, typically a colon (
:)Optional leaf-node value separated by a pipe (
|) for display ID mapping
Example input field (raw from SharePoint)
"test_s": "Country:I:India;Country:U:United States"This must be transformed into a multi-valued field for proper hierarchical parsing.
Transformed output (multi-valued format)
"test_s": [
"0:Country",
"1:Country:I",
"1:Country:U",
"2:Country:I:India",
"2:Country:U:United States"
]Apply similar transformation to other hierarchical fields as needed. Ensure:
Each level has a depth prefix
The delimiter between categories is colon
:The final leaf item may include a
|IDif required
Apply facet templates in Rules
Navigate to Rules > Templates
Add the transformed field (e.g.,
test_s)Set the hierarchical delimiter to
:in the configurationPublish the rule to make the facet available
Test facet behavior in Predictive Merchandiser
Once the field is properly indexed and the rule is applied:
Navigate to Predictive Merchandiser
Enable the facet field
Verify the hierarchical structure renders as expected
If necessary, validate that your facet levels are correctly parsed
If the UI does not render a hierarchy:
Ensure that values are indexed as multi-valued
Confirm depth prefixes and delimiter formatting are consistent
Use the query workbench for direct field inspection
Query syntax for hierarchical facets
Hierarchical facets use standard Solr facet queries but require structured filtering when values are selected.
Example: Selecting a second-level facet (e.g., "women > pants")
fq=category_ss:"1/women/pants"Matching descendants
If child levels should be included, use a prefix or wildcard filter:
fq=category_ss:"1/women/pants*" Or:
fq=category_ss:("1/women/pants" OR "2/women/pants/jeans")This ensures that selecting a parent category will include all subcategories.
Notes:
Prefix matching behaviour may depend on the configuration of your Solr field
Default behaviour in Predictive Merchandiser includes descendants unless otherwise restricted
If after indexing and configuring the field the hierarchy still does not appear, verify all formatting and consider checking the Solr logs for any possible warnings or error related to faceting queries.