-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: terms incorrectly indexed when ORDER BY t.term_order is applied #4092
Comments
Hi @katag9k, Would you mind explaining what you're trying to achieve? I tested the code you shared, and it throws a database error Regards, |
@burhandodhy Apologies, it should be term_order, not t.term_order. This filter comes from a third-party plugin called Category Order and Taxonomy Terms Order. When the plugin is active with this filter, not all terms are indexed during bulk indexing. I suspect that the terms_clauses filter needs to be removed to ensure the correct ORDER BY id behaviour.
Maybe here somewhere:
|
@katag9k You need to prevent the WHERE clause from taking effect during the sync process. I reviewed the plugin code and found that it includes a filter Also. ElasticPress provides a helper function, The final code will look something like this
|
@burhandodhy this solution only addresses one specific plugin. Other plugins or custom code may also modify via |
Describe the bug
When the ORDER BY t.term_order clause is applied via the terms_clauses filter, not all terms are indexed. For example, the taxonomy-terms-order plugin sets
This causes only about half of the terms to be indexed. Removing this filter allows the indexing process to complete properly.
Steps to Reproduce
add the filter to your theme
Try indexing terms, although the message will appear that all terms are indexed the actual count of the indexed terms is off. Out of 121,319 terms, only about 69,650 were indexed.
WordPress and ElasticPress information
WordPress 6.7.2
Elasticsearch - 7.17.8
WPVIP
Code of Conduct
The text was updated successfully, but these errors were encountered: