es-wp-query
                                
                                 es-wp-query copied to clipboard
                                
                                    es-wp-query copied to clipboard
                            
                            
                            
                        Image Search Enhancements
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).
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.
@mboynes Not sure on the next steps here. Let me know if you found previous examples of how this was handled.