Elasticpress: /?post_type=ignored

Created on 26 Jun 2019  路  3Comments  路  Source: 10up/ElasticPress

__Have you searched for similar issues before submitting this one?__
I think it's related to: https://github.com/10up/ElasticPress/issues/1257 and https://github.com/10up/ElasticPress/issues/1188 and https://github.com/10up/ElasticPress/issues/649
__Is this a bug, question or feature request?__
I'm afraid i'll have to say bug. It always seems to get ignored due to inactivity.
__Describe the issue you encountered:__
basically EP doesn't respect the post_type parameter of the query.
Be it in the url as parameter ie:
/?s=query&post_type=pepe
or with set query:
$query->set('post_type', 'pepe');
__Current WordPress version?__
5.2.2
__Current ElasticPress version?__
3.0.3
__Current Elasticsearch version?__
6.3.0
__Where do you host your Elasticsearch server?__
self host
__What ElasticPress features do you have currently active?__
Post Search, Facets
__Other plugins installed (WooCommerce, Simple Redirect Manager, etc..)?__
Advanced Custom Fields PRO Version 5.8.1 by Elliot Condon
Classic Editor Version 1.5 by WordPress Contributors
Custom Post Type UI Version 1.6.2 by WebDevStudios
ElasticPress Version 3.0.3 by Taylor Lovett, Matt Gross, Aaron Holbrook, 10up
GD Rating System Version 3.5.5 by Milan Petrovic
Query Monitor Version 3.3.6 by John Blackbourn
Related Posts By Taxonomy Version 2.7.1 by keesiemijer
Term Management Tools Version 1.1.4 by scribu
W3 Total Cache Version 0.9.7.5 by Frederick Townes
WP Mail SMTP Version 1.4.2 by WPForms
WP User Avatar Version 2.2.4 by flippercode
Yoast SEO Version 10.1.3 by Team Yoast (Latest version: 11.5)

__Steps to reproduce:__

  1. Have a custom type 'pepe' for example.
  2. Search something.
  3. Add &post_type=pepe to the search url
  4. Should only return posts from pepe type but return posts from all types.
  5. Pepe cries.

__Screenshots, if needed:__
tenor

confirmed bug

Most helpful comment

@Salamander3 your dreams may be coming true. This seems like a bug. @oscarssanchez will look at it.

All 3 comments

@Salamander3 your dreams may be coming true. This seems like a bug. @oscarssanchez will look at it.

Hi @Salamander3 ,

Unfortunately, I'm not able to reproduce the behavior you are describing, even with the plugins you listed.

Default results: https://cloudup.com/cDfbrXwT65l
With post_type=pepe: https://cloudup.com/clUOzLeSLcj

The only way I got all post types to show up when using a ?post_type=<post_type> type filter in the URL was when I used an invalid post type name in the url (I tried pepes instead of the correct pepe and it showed all post types).

A few things to try:

  1. Double check the proper post type name is being used in the URL. When you filter with ?post_type=post do you see only posts coming back?
  2. I wasn't able to get ahold of GD Rating System Version 3.5.5 (only 2.7) so its possibly that could be the culprit (though not sure this is likely)
  3. I don't have a copy of ACF pro, so I tested with version 5.8.1 from the wordpress.org repository
  4. If none of the above seem to be helping, can you try using a default theme and see if the behavior changes? Its possible there is some theme code running that could be causing this behavior.

It was a problem on my end, i found it and fixed it sorry.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mihaijoldis picture mihaijoldis  路  6Comments

barryceelen picture barryceelen  路  4Comments

JJJ picture JJJ  路  5Comments

vnmedeiros picture vnmedeiros  路  3Comments

MediaMaquina picture MediaMaquina  路  5Comments