Help Center
Indexer Does Not Work and Shows 0

Indexer Does Not Work and Shows 0

Why does the Indexer show 0 in my filters?

Answer
Modified on: Tue, 26 Sep, 2023

There are multiple reasons why the Indexer can show zeros instead of the actual count of items per filter’s option. Check the possible causes and solutions in this tutorial.

Check Whether the Indexer Is Enabled for Filtered Object

Go to WordPress Dashboard > Crocoblock > JetPlugins Settings > JetSmartFilters > Indexer Settings and enable the toggles for all objects that should be filtered and indexed.

index post types section in the indexer settings

Check if the Query IDs in the Settings Are Identical

If Query Builder functionality is used, ensure that the CSS ID in the filter widget and posts widget settings are the same as the Query ID set in the Query Builder.

For instance, the Query Builder includes the “filter-query” value in the Query Builder settings.

query id in query builder

The same “filter-query” value should be pasted in the CSS ID field of the filter widget’s Advanced tab.

css id in checkbox filter

Also, use the same value in the Advanced settings of the posts widget (in the Listing Grid, for instance.)

css id in listing grid

Check Filter Settings

If the “Taxonomies” options are set as Data Source, ensure the Is Checkbox Meta Field (Jet Engine) toggle is disabled. Otherwise, it can be the reason why the indexer is not working. This toggle can be applied for the “Custom Fields” source.

is checkbox meta field toggle

One more thing to check is the Exclude/Include field if you work with “Checkboxes list,” “Select,” or “Radio” Filter Types. If either “Include” or “Exclude” options are selected (not “None”), the following Exclude or Include Items field should not be empty.

exclude or include items field

Check if the Values Used as a Filter Source Have the Correct Values

We used the Checkbox Filter as an example of a filter setup. The Checkbox Filter is based on a meta field that has the manual options displayed.

Warning

The Indexer can work only with the options using Latin lowercase characters without spaces and special characters.

The incorrect work happens because the Indexer request to the database can not be performed correctly if the values do not follow the proper syntax. 

However, the Labels can be formatted in any desired way.

checkbox options list

The same applies to the options in a Glossary. If you use a JetEngine Glossary as a filter source, the values in the options must be lowercase, with no spaces to be indexed by the Indexer

If you use an incorrect glossary as a filter source, you should edit the values to lowercase and remove spaces.

field value in the glossaries tab

However, additional actions are required to fix the Indexer after editing the values in the meta field options or the glossary. 

Resaving each post/CCT item, user, etc., containing a meta field with edited values is crucial.

The process of resaving the values also needs to be done following these steps:

  • go to the edit page of an object (post, CCT item, user, etc.) on the backend and uncheck the option or multiple options in the meta field;
  • save the object with an empty meta field;
  • reselect the needed options in the meta field and save the object again;
  • repeat the steps for all other objects.

To ensure the new values are successfully saved in the database after resaving them, you can check the values in the meta fields of the objects via the following two tools.

Via JetEngine Query Builder

In the Query Builder, you can create a query of an “SQL/AI” Query Type and select a relevant table in which the meta field is saved. It can be postmeta, usermeta, or CCT table.

Add the following query clause to see the values of the needed meta field in the “meta_value” column. 

Complete the Column field with the “meta_key” value, set the Compare operator to “Equal,” and fill in the Value field with your field name.

custom sql query with usermeta table as source

Activate the Preview results toggle at the top of the page. If you still see incorrect values in the “meta_value” column, go back to the edit page of the relevant object, reselect, and resave the options in the meta field.

preview query

Via phpMyAdmin

You can use the same approach as in the Query Builder in phpMyAdmin.

Go to a table where the meta field is stored. Click on the table, go to the Search tab, and insert the meta field name into “meta_key” to find users with values in this meta field.

phpmyadmin search by meta key

After pressing the “Go” button, you should see the values of the meta field in the “meta_value” column, which helps to understand whether the values have been updated after resaving the objects.

phpmyadmin usermeta table search

Re-Index Filters With a Button

If the values in meta fields are written correctly, and the Indexer is enabled for a needed object, it may be helpful to reindex the filters. 

To do so, go to WordPress Dashboard > Smart Filters and press the “Apply Indexer” button.

apply indexer button

Re-Activate the JetSmartFilters Plugin

We also recommend deactivating and activating the JetSmartFilters plugin in the WordPress Dashboard > Plugins tab.

jetsmartfilters plugin

If you followed the suggestions above and still experience issues, we recommend contacting our support team for further assistance.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.