-
Notifications
You must be signed in to change notification settings - Fork 313
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
Categories & Tags do not get synced on post save but on bulk sync #3949
Comments
Hi goaround, My guess is that there may be an issue on the server. Have you checked the server logs? Does the behavior remain the same when you update the post using the WP-CLI command? Regards, |
If I update the post using the WP-CLI the category and tags get synced. Only on a post update not... |
@goaround You'll have to debug the query being sent to Elasticsearch when a post is saved. To do that, install our Debug Add-On, go to ElasticPress > Query Log, and set it to log all queries, but only in the REST API context: Then, go to a post, make a change to it, and save it. Going back to the Query Log page, you'll see a new request in the list. Disable Query Log (don't keep it running on production environments) and give a look at the "Query Body" of the request. That should contain all tax info, and point you to what could be going wrong. If you want, feel free to share the Request Info with us too, and we can try to help you debugging it further. |
It has been 3 days since more information was requested from you in this issue and we have not heard back. This issue is now marked as stale and will be closed in 3 days, but if you have more information to add then please comment and the issue will stay open. |
Hi @felipeelia, I just checked the logs. I just removed some personal informations from the author and the post content to keep it short. Here on a post change:
And here if I run the bulk sync on the settings page but just for the one post:
As you can see, the "category" is missing on post save but present on the bulk sync... |
I noticed the same thing where as categories for posts were not indexed and the category page showed "No Post Results". Did a manual resync of the "post" post type and it then started working again. |
@goaround thanks for sharing the logs. I suspect this could be related to the point in the code where you are (1) registering that ElasticPress goes through these methods to figure out which taxonomies should be indexed with a post:
Any chance you can debug that get_indexable_post_taxonomies() method, checking if the category taxonomy is returned in the first get_object_taxonomies() call? And if it is, can you please check if it is discarded during that foreach loop right by the end of the method? Thanks |
It has been 3 days since more information was requested from you in this issue and we have not heard back. This issue is now marked as stale and will be closed in 3 days, but if you have more information to add then please comment and the issue will stay open. |
Hi @felipeelia, I checked get_indexable_post_taxonomies(), prepare_terms(), prepare_document() on save and all contains the category and post_tags But I noticed one more thing: There are always two sync requests to Elasticsearch: 1. with context admin and the 2. with context rest. The first with content admin does not contain the categories and post_tags and the 2. with context rest contains all categories and post_tags. Any idea why there are two requests? Is this normal?
|
It has been 3 days since more information was requested from you in this issue and we have not heard back. This issue is now marked as stale and will be closed in 3 days, but if you have more information to add then please comment and the issue will stay open. |
I still have this issue |
Although I can see WordPress sending those 2 requests, I consistently get taxonomy terms getting sent on both with the same value. As the redundancy comes from WP itself, I don't think it is a good idea to try to optimize EP to send just one of them, so at least for now we'll continue to send those 2 requests, the same way WP does. For the case you have at hand, @goaround (if you still have this issue) I recommend you try to disable all your plugins and enable them one by one to debug it. I'd also triple-check any custom code related to taxonomies. The problem could be happening due to some wrong optimization attempt, for example. |
Describe your question
Hi,
I have a strange behavior on my production site, which I unfortunately can't reproduce locally.
Categories and tags of a post do not get synced if a post is saved. But if I run a bulk sync, they get synced. Other custom taxonomies get synced as they should be, but not the build in categories and tags...
Really strange, and I don't know where I should look anymore. Do you have any idea what could trigger this behavior?
Code of Conduct
The text was updated successfully, but these errors were encountered: