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

Set ep_sync_terms_allow_hierarchy to false by default #70

Open
WPprodigy opened this issue Nov 16, 2020 · 1 comment
Open

Set ep_sync_terms_allow_hierarchy to false by default #70

WPprodigy opened this issue Nov 16, 2020 · 1 comment

Comments

@WPprodigy
Copy link

WPprodigy commented Nov 16, 2020

https://github.com/Automattic/ElasticPress/blob/develop/includes/classes/Indexable/Post/Post.php#L519-L526

This feels like behavior that should be opt-in rather than opt-out. It changes functionality of queries rather significantly, as before offloading to ES you would only be receiving posts actually attached to a term. But with this enabled - you can get a much more wide range of posts with no way to filter it down since all terms are treated the same in the index.

@WPprodigy
Copy link
Author

WPprodigy commented Nov 16, 2020

Unless there's a way to treat the parent terms separately in the index so that they are only involved if specifically requested for the query (this way we don't need to re-index if a change is made)?

That said, WP doesn't really have any query params I can find that are meant to "include parents"? There is include_children, which is handled pre-ES in es-wp-query here: https://github.com/alleyinteractive/es-wp-query/blob/47a40ab7d6e2860ca47b50532cc9f735d3c5c43b/class-es-wp-tax-query.php#L269-L282

If the terms could be "stored separately" and then only invoked when maybe a new include_parents query arg is passed, that could be cool. If not possible though to "store separately", this should definitely be opt-in and disabled by default.

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

No branches or pull requests

1 participant