Faceted Filtering

Faceted search is the most useful and popular mode to filter catalogs of online retailers.

In Zephyr the Faceted Filtering is used by the List Filter element to improve UX while filtering lists of posts, pages, products, and custom post types. The main goal is to adapt the filtering options for the user's choice to the displayed result.

Advantages of the Faceted Filtering:

  • List Filter values adapt to the Post List output
  • List Filter values show amount of available posts
  • List Filter values can be hidden if they are no longer available after filtering

How to enable the Faceted Filtering? #

  1. Open the List Filter "More options" settings tab, and enable the relevant "Faceted Filtering" switch, save the changes.
  2. Open settings of the related Post List or Product List element and enable the "Use URL params to show results" switch, save the changes. This option is enabled by default if the list shows posts of the current query.
  3. Go to Theme Options > Advanced > Faceted Filtering section and click the "Index filter items" button. Once indexing is complete, your List Filter element will take all advantages of the Faceted Filtering.

What does indexing do? #

The WordPress database has different separate tables of posts attributes (dates, authors, taxonomy terms, custom fields, etc.). Therefore, counting the number of posts for each user selection creates heavy queries to the database. The more filtering parameters, the heavier the query, the longer the page loads.

That's why Zephyr creates its own database table for using by Faceted Filtering. When you start the indexing process, it:

  1. gets only used filter sources, based on List Filter elements added to your site
  2. gets all published posts (of any post type), that have these sources
  3. populates the database table with combinations of all found posts and sources

That new table allows for faster calculation of the number of posts for each user selection.

When do I need to do indexing? #

  • When you add the new List Filter element with the enabled "Faceted Filtering" switch.
  • When you change sources of any List Filter element with the enabled "Faceted Filtering" switch.

To avoid manual re-indexing when you create/edit/delete a post or a taxonomy term, just enable the "Automatic re-indexing" switch on Theme Options > Advanced > Faceted Filtering.