-
Notifications
You must be signed in to change notification settings - Fork 313
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
Introduce native facet mappings #2071
Introduce native facet mappings #2071
Conversation
This reverts commit 32eb2e5.
I've tested this and it works fine. Two things we'll need to do after we merge:
|
@@ -429,6 +429,9 @@ private function prepare_terms( $post ) { | |||
'term_taxonomy_id' => $term->term_taxonomy_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@felipeelia Can you check if there a reason why we only collect the term_taxonomy_id
here and not when getting parent terms in line 462 below? I have checked annotations and this difference has been around since tt_ids were introduced in #840
I've now bumped into an issue in hierarchical taxonomies in which the new native facet is stored twice because of this. It's stored once with term_taxonomy_id
(created here) and once without it (created in get_parent_terms()
below, whenever a child term is stored).
Adding term_taxonomy_id
to parent terms fixes the issue, but I wanted to check if there is any reason why it didn't have that in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was just something we missed until now, @moraleida.
@brandwaffle can we aim to have this merged in 3.6.0?
Description of the Change
Fixes #2078
Introduces a new
keyword
field for mapping terms within posts. The new field holds the entire term object in json form and is accessible atterms.{$taxonomy}.facet
The idea is that instead of aggregating via
terms.{$taxonomy}.slug
and getting only a subset of the data, we can run aggregations using the newfacet
key and get all the information needed.The stored post object contains terms in this format:
Aggregations can then be requested using the
facet
fieldAnd return the entire JSON object:
Alternate Designs
Benefits
Possible Drawbacks
Verification Process
Checklist:
Applicable Issues
Changelog Entry