-
Notifications
You must be signed in to change notification settings - Fork 314
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: Wrong results while filtering by category using 'tax_query' #2242
Comments
Sure There is an improvement using #2241 - Possibly I'm facing some 2 overlapping problems, one of which is solved in #2241. Not sure about that though. WP_Query
Query body
Query args
|
Confirmed the bug. Problem seems to be happening at https://github.com/10up/ElasticPress/blob/develop/includes/classes/Indexable/Post/Post.php#L909 |
Describe the bug
I have a pretty simple query - find all published posts that have any of given categories. Works fine without Elastipress(without
ep_integrate
flag).However when ElasticPress is on, the query generated for Elasticsearch seems to have some redundant conditions. It does search by
terms.category.term_id: ["2","6","1"]
, but it also adds"terms.category.term_id": [2]
and"terms.category.slug": [ "custom-category"]
for the reason uknown to me. ('custom-category' is the slug of the category with ID=2)As a result not all of the desired posts are returned.
I'm attaching data from Debug Bar below:
Query Args:
Query body:
Expected behavior
Query should return posts that have any of given categories
Environment information
The text was updated successfully, but these errors were encountered: