Hierarchical Categories β€” Facet Drill-Down Navigation

Breadcrumb-style drill-down facets from your category tree

Hierarchical Categories

Hierarchical categories enable breadcrumb-style drill-down navigation in your search sidebar: click Clothing to see sub-categories, click T-Shirts to see only tees. Powered by item_list_element_N_name_sm Solr fields built automatically from your WordPress category tree β€” no configuration needed on the plugin side.

What You Get

Once configured, your search sidebar shows a drill-down facet. Visitors click any level to zoom in β€” a breadcrumb trail and back button keep navigation intuitive at every level:

Clothingitem_list_element_1T-Shirtsitem_list_element_2Graphic Teesitem_list_element_3depth 1 = root Β· depth 2 = child Β· depth 3 = leaf (most specific)

How It Works

During ingestion, the plugin scans all hierarchical taxonomies registered on the post type. For each assigned term, it walks up the parent chain to the root, then assigns each level to a positional Solr field:

  • item_list_element_1_name_sm β€” root / top-level ancestor (depth 1)
  • item_list_element_2_name_sm β€” second level (depth 2)
  • item_list_element_3_name_sm β€” third level (depth 3)
  • … up to depth 6

You only assign a post or product to the most specific (leaf) category β€” the plugin finds all ancestors automatically via WordPress's get_ancestors() function. You do not need to also select parent categories.

Zero plugin configuration needed

The item_list_element_N_name_sm fields are built automatically during real-time sync and bulk ingestion. They appear in the Facet Configuration table automatically once content is ingested. The only setup required is building your category tree in WordPress and assigning posts to leaf categories.

Two Supported Category Types

Posts β€” WordPress Categories

Standard WordPress categories (the built-in category taxonomy). Use Posts → Categories in the admin to build the tree. Categories are hierarchical by default.

WooCommerce β€” Product Categories

WooCommerce product categories (product_cat taxonomy). Use Products → Categories to build the tree. Assign products to leaf categories β€” the plugin handles the full hierarchy chain automatically.

Step 1 β€” Build Your Category Tree

For posts β€” go to Posts → Categories:

  1. Add your top-level categories first (e.g., "Electronics", "Books")
  2. Add child categories β€” for each child, set the Parent Category dropdown to the appropriate parent
  3. Continue adding sub-levels as needed β€” up to 6 levels deep

For WooCommerce products β€” go to Products → Categories:

  1. Add your root product categories (e.g., "Clothing", "Electronics")
  2. Add child categories and set their Parent Category
  3. Continue for as many levels as needed (max 6)

Step 2 β€” Assign Posts / Products to Leaf Categories

When editing a post or product, select only the most specific (deepest) category that applies. Do not also check parent categories β€” that causes duplicate values at root depth levels.

Assign to the leaf category only

For a post about gaming laptops: check "Gaming Laptops" only β€” do NOT also check "Laptops", "Computers", or "Electronics". The plugin automatically discovers "Electronics" (depth 1), "Computers" (depth 2), "Laptops" (depth 3), and "Gaming Laptops" (depth 4) by walking up the parent chain.

Step 3 β€” Ingest Your Content

The plugin picks up category hierarchies automatically during ingestion. No additional configuration is needed.

  • Real-time sync β€” fires on save_post hook. Every time you save or update a post, the category hierarchy is pushed immediately to Opensolr.
  • Bulk ingestion β€” go to the Data Ingestion tab and click Ingest All Now to re-process your full content library after adding or restructuring categories.

Solr Fields Produced

For a product assigned to "Gaming Laptops" (child of "Laptops" → "Computers" → "Electronics"), ingestion produces:

Solr Field Value (example) Depth
item_list_element_1_name_sm Electronics 1 β€” root / top-level
item_list_element_2_name_sm Computers 2 β€” second level
item_list_element_3_name_sm Laptops 3 β€” third level
item_list_element_4_name_sm Gaming Laptops 4 β€” leaf (most specific)

All fields use the _sm suffix β€” multi-valued string. If a post is assigned to multiple leaf categories from different branches, each chain is merged: values at each depth level accumulate across all branches.

Step 4 β€” Enable the Hierarchical Facet Widget

Once content is ingested, the item_list_element_* fields appear in the Facet Configuration table automatically.

  1. Go to Settings → Opensolr Search → Facet Mapping tab
  2. Find item_list_element_1_name_sm in the Facet Configuration section
  3. Set the Widget column to Hierarchical
  4. Set a Display Label (e.g., "Category", "Department")
  5. Check the Enable checkbox to show the facet on the search page
  6. Save the configuration

The search page shows the drill-down facet automatically. You only configure the depth-1 field β€” the plugin detects all deeper item_list_element_N_name_sm fields automatically when rendering the hierarchical widget.

Custom Hierarchical Taxonomies

Any custom taxonomy registered with 'hierarchical' => true and attached to an enabled content type is picked up automatically. No plugin configuration needed β€” just register the taxonomy, build the tree, and assign posts to leaf terms.

Works with Crawler Too

The web crawler also builds item_list_element_N_name_sm fields from the JSON-LD BreadcrumbList the plugin outputs on each page. Both ingestion and crawler produce identical fields β€” the same hierarchical facet works regardless of how content was indexed.

Hierarchical facet configured?

Visit your site's /search/ page and click a top-level category in the sidebar β€” it should drill into sub-categories. See Facets & Filters for more on widget types, ordering, and configuration options.