Skip to content
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

Image Search Enhancements #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mdbitz
Copy link
Contributor

@mdbitz mdbitz commented Jul 24, 2018

ES_WP_Query currently does a prefix search on the post_mime_type field. To perform this type of query the raw field needs to be utilized.

Currently no support exists for the "inherit" post_status search. This is a common post_status used when doing image searches. This patch sets the post_type equal to all searchable post_status (same logic as used for the post_status any).

mdbitz added 2 commits July 24, 2018 13:47
ES_WP_Query currently does a prefix search on the post_mime_type field. To perform this type of query the raw field needs to be utilizied.

Currently no support exists for the "inherit" post_status search. This is the base post_status used when doing image searches. This patch sets the post_type equals to all searchable post_status (same as any).
@mdbitz
Copy link
Contributor Author

mdbitz commented Jul 27, 2018

Some Notes from Greg:

Hmmm, I am unsure what the right thing to do is. it probably isn’t safe to map inherit to any. one thing we could do in the index is to include multiple post statuses in that field. So index the post_status field as array( "inherit", <parent_post_status> ). Unsure if that would cause other problems, but maybe solve your querying problem.

hmmm, i mean i guess “inherit” could mean anything and so thus it is kinda equivalent to “any”
that really assumes that everything for that post type is set to “inherit” though

My Notes :

I've been looking into this further and I'm not seeing a better way to handle the "inherit" status currently.

By having the ES search happen against all we get the full set of results back. then when shoehorn runs and does the look-up by post_ids it still uses post_status="inherit" so the final posts returned won't leak any items.

There is a possibility that the ES search could return items the WP search would exclude.

@mdbitz
Copy link
Contributor Author

mdbitz commented Jul 27, 2018

@mboynes Not sure on the next steps here. Let me know if you found previous examples of how this was handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant