-
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: Queries with "orderby=type" or "orderby=post_type" do not work with ElasticPress. #1257
Comments
@dannydamsky thanks for submitting this issue! One quick question I'm hoping you can clarify: in #3 on the steps to reproduce, you mentioned the result is the same with the plugin disabled. Am I understanding that correctly or does the orderby=type query work if ElasticPress is turned off? |
The result is the same in the sense that in both cases ElasticPress doesn't work. The query always works, but when I add orderby=type it doesn't fetch the results from ElasticPress. This is apparent because ElasticPress fetches certain search results (PDF files containing the keyword for example) that do not appear when the plugin is disabled and/or when the orderby=type parameter is used. |
@dannydamsky i don't know if this will help you. But since i'm an idiot and wasn't aware of the existence of "type" i created my own parameter. Which works for me. So if you are just interested in get this working ASAP you could use my method. But i think EP team should dig into the original issue for a solution. My workaround concist on creating a new parameter let's call it something unused like: thetype So on the link you use it like: And then add this on functions.php add:
This works on my end, not a solution to the original problem but a workaround as i said. Cheers! |
Since 3.03 my code above doesn't work any more.
But it doesn't do it. Why? |
@oscarssanchez is investigating. |
I am using Elasticsearch with the Ingest Attachment plugin installed so that queries in documents are enabled in ElasticPress.
What I'm trying to do is get search results with PDF files that contain the search query inside them.
It works. But only if I do NOT provide the "orderby=type" parameter in the request/in the WP_Query.
If I provide the parameter, the ordering is done correctly, but the results that ElasticPress fetched from the documents do not appear in the search.
After Googling for hours and trying a bunch of things in with WP_Query, I have absolutely no idea how to fix this issue.
One thing to note is that "orderby=title" DOES work for some reason.
Current WordPress version: 5.0.2
Current ElasticPress version: 2.8.1
Current Elasticsearch version: 6.4.0 (same results with 6.3.0 as well)
Where do you host your Elasticsearch server: http://127.0.0.1:9200
Other plugins installed (WooCommerce, Simple Redirect Manager, etc..):
ACF to REST API
Advanced Custom Fields
Advanced Custom Fields PRO
Advanced Custom Fields: Ninjaforms Add-on
Enable Visual Mode in CloudFront
EventON
EventON - Full cal
Google Analytics +
JSON Basic Authentication
Media Library Assistant
Nav Menu Images
Ninja Forms
Restore Image Title
ShareThis Share Buttons
Shield
Simple CSV/XLS Exporter
Smush Pro
TinyMCE Advanced
Toolset Types
Ultimate Tag Cloud Widget
User Role Editor
W3 Total Cache
WP Add Mime Types
WP Mail SMTP
WP Mailto Links - Manage Email Links
WP REST API - filter fields
WP REST API - Meta Endpoints
WPML Media
WPML Multilingual CMS
WPML String Translation
WPML Translation Management
WPMU DEV Dashboard
WR MegaMenu
Steps to reproduce:
The text was updated successfully, but these errors were encountered: