1. Home
  2. Knowledge Base
  3. WooCommerce Product Filters
  4. FAQ

How does the filter index work?

WooCommerce Product Filters has a built-in indexing system which allows the filters to work quickly for large product database, without performance issues.

Having an index means that there’s no need to do complex calculations and slow queries. When a customer uses a filters, the plugin simply looks at the indexed values which is much faster than querying the entire database.

How to trigger a re-index

WooCommerce Product Filters will automatically start the re-indexing process when you make changes which will affect the data in the index. This happens in the following situations:

  • When you create or save a filter group.
  • When you add, delete or update a product.
  • When you add, delete or update a product taxonomy (i.e. categories, tags and global attributes).

If you make multiple changes which would trigger a re-index then the previous indexing process is aborted and a new one started. This reduces the load on your website.

What should I do while the indexing is taking place?

When the plugin is building or rebuilding the index, a message will appear in the WordPress admin informing you that the indexing process is taking place. This message will disappear once the indexing is complete.

The filters on the front end of the website may not reflect your latest changes until the indexing is complete.

You do not need to wait for the indexing process to finish. This is a background job and you can navigate away from the page without affecting the indexing process.

Technical information for developers

The indexing feature in WooCommerce Product Filters is based on the indexing in plugins like SearchWP and FacetWP, but with some improvements.

A custom database table is created and it stores all the values belonging to each filter and product on the site. This is needed because WordPress' standard method for handling queries and post meta during a search is slow.

To reduce the load on your server, the index is built in batches of 30 products at a time. This technique is used by other popular WooCommerce extensions like Memberships and Subscriptions. You can change this default using the filter from the developer documentation.

The indexing functionality relies on the Actions Scheduler component that is built into WooCommerce.

You can also access the tool by navigating to Tools → Scheduled actions. This page contains a table of default background jobs performed by WooCommerce itself, plus other plugins. Search for 'wcf' to find background jobs created by WooCommerce Product Filters.

Related Articles

If searching the knowledge base hasn't answered your question, please contact support.