You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When filtering REST API post type queries with $args['ep_integrate'] = true; for a post type, you can no longer make a request with slug=post-name as a query parameter. You get back the 10 most recent posts of that post type.
Unfortunately, since this is only observed while querying the REST API, I haven't found a way to be able to inspect the queries being generated in EP or what that looks like on the ES side of things.
Steps to Reproduce
Filter a specific post type query, rest_post_query or rest_CUSTOMPOSTTYPE_query and prior to returning $args set $args['ep_integrate'] = true.
Make a request to /wp-json/wp/v2/POSTTYPE?slug=APOSTSLUG You'll get back the latest 10 posts of that post type.
Remove $args['ep_integrate'] = true and make the same request. You should get back the specific requested data.
Expected behavior
The only post(s) we should receive back when passing in ?slug= to the REST API are the specific posts that correspond to the passed in post_name__in array.
Environment information
Device: MacBook Pro
OS: OS X, Linux, Doesn't matter
Browser and version: Postman
Plugins and version: ElasticPress 3.1.4
Theme and version: Custom Build
Other installed plugin(s) and version(s): N/A
Additional context
I tested this with a few different rest_POSTTYPE_query filters for different post types and it only works when I remove the code to integrate the query into ElasticPress.
Maybe this isn't an actual bug on the EP side and I'm just lost in a rabbit hole and this is all for naught.
The other thought i had was that maybe ElasticSearch just doesn't know what to do with the post_name__in argument and how to map that as there's no slug value in ES when querying through Kibana, but there is post_name. Is it maybe possible that maybe EPdoesn't have a way to associate post_name__in to post_name in ES?
Thanks!
The text was updated successfully, but these errors were encountered:
Describe the bug
When filtering REST API post type queries with
$args['ep_integrate'] = true;
for a post type, you can no longer make a request withslug=post-name
as a query parameter. You get back the 10 most recent posts of that post type.Unfortunately, since this is only observed while querying the REST API, I haven't found a way to be able to inspect the queries being generated in EP or what that looks like on the ES side of things.
Steps to Reproduce
Filter a specific post type query,
rest_post_query
orrest_CUSTOMPOSTTYPE_query
and prior to returning$args
set$args['ep_integrate'] = true
.Make a request to
/wp-json/wp/v2/POSTTYPE?slug=APOSTSLUG
You'll get back the latest 10 posts of that post type.Remove
$args['ep_integrate'] = true
and make the same request. You should get back the specific requested data.Expected behavior
The only post(s) we should receive back when passing in ?slug= to the REST API are the specific posts that correspond to the passed in post_name__in array.
Environment information
Additional context
I tested this with a few different
rest_POSTTYPE_query
filters for different post types and it only works when I remove the code to integrate the query into ElasticPress.Maybe this isn't an actual bug on the EP side and I'm just lost in a rabbit hole and this is all for naught.
The other thought i had was that maybe ElasticSearch just doesn't know what to do with the
post_name__in
argument and how to map that as there's no slug value in ES when querying through Kibana, but there ispost_name
. Is it maybe possible that maybe EPdoesn't have a way to associatepost_name__in
topost_name
in ES?Thanks!
The text was updated successfully, but these errors were encountered: