A hierarchical filter lets visitors drill down through your categories: click Electronics to see its sub-categories, then Laptops to see only laptops. The plugin builds it from the category tree you already have in WordPress or WooCommerce.
Which categories
- Post Categories (Posts > Categories).
- WooCommerce Product categories (Products > Categories).
- With Data Ingestion, also any custom taxonomy that is hierarchical and attached to a post type you send.
Set it up
- Build your tree in WordPress: top categories first, then children with their Parent Category set. Up to 6 levels are used.
- On each post or product, tick only the most specific category. Its parents are added for you.
- Crawl or ingest your content again, so the levels reach your index.
- On the Facet Mapping tab, under Facet Configuration, find
item_list_element_1_name_sm, tick Enable, set the Widget to Hierarchical (drill-down) and give it a Label, such as "Category". - Click Save Facet Settings. You only set up level 1: the deeper levels are found by themselves.
The levels in your index
A product in Gaming Laptops, under Laptops, Computers and Electronics, carries one field per level:
- Level 1, the top: Electronics, in
item_list_element_1_name_sm - Level 2: Computers, in
item_list_element_2_name_sm - Level 3: Laptops, in
item_list_element_3_name_sm - Level 4, the most specific: Gaming Laptops, in
item_list_element_4_name_sm
Crawled or pushed
- Data Ingestion sends every category path of a post. A post in two branches is found in both.
- Data Crawler: the plugin prints the path of the most specific category of each post or product in the page, as breadcrumb structured data, and the crawl turns it into the same fields.
What visitors see
The top categories with their counts. A click shows the children of that category, with a way back up, and the choice appears among the active filters above the results. Removing a category also removes the levels under it.
The other filter widgets: Facet Configuration. Categories on every Opensolr index: Prices and product categories.