-
Notifications
You must be signed in to change notification settings - Fork 317
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
Add a Terms Indexable #1443
Add a Terms Indexable #1443
Conversation
…re that can be turned on. Set up proper mapping and initial indexing of terms.
@brandwaffle @tlovett1 @tott please let me know once this gets through code review as we'll look to have someone else from the team help with any changes from that review... thanks! |
@tlovett1 the two build failures appear related to the weighting work. Are you seeing weighting-related issues in this PR or is this good to be merged in alongside the WP 5.3 release in November? Essentially, do you need anything else from the team? |
@petenelson what's the status of unit tests on this one? Thanks. |
With the latest
I'll take a look at these, as well as code coverage for the rest of the term unit tests. |
…term' as a level under 'mapping' to match the 7.0 mapping for posts
…rm instead of assuming parent term IDs
Terms indexable updates
Description of the Change
A new filter was added to WordPress core (coming in 5.3), that allows term queries to be short-circuited with your own results. This provides the ability for ElasticPress to take over any queries that utilize
WP_Term_Query
.This PR adds a new Terms Indexable that will index all terms across a site and then takes over term queries if
ep_integrate
is set to true.Benefits
Terms will now be stored in their own index and they can be searched across. Any queries that make use of
WP_Term_Query
can gain potential performance benefits by utilizing elasticsearch over a normal database query.Possible Drawbacks
Not all queries will be made faster by this integration, so testing will need to be done to determine if it's worth using elasticsearch for term queries.
Anytime objects are updated that have terms associated with them, we re-index those terms, resulting in possibly longer save runs.
Verification Process
Tested these changes locally on a multisite install, with 4 sites on the network. Each site had a handful of categories and tags set; some nested, some not; some with term meta, most not; most associated with at least one object, some associated with nothing.
WP_Term_Query
, withep_integrate
set to true, runs the query against elasticsearchWP_Term_Query
supports, to make sure those work when run against elasticsearchNote further testing is recommended here, to further ensure all the various query params work, especially when used in conjunction with each other. Also more testing around updating terms and adding/updating posts that use terms, to make sure things are updated correctly, particularly the term counts.
Checklist: