[5.x] Check ES types for keyword instead of guessing#1201
Merged
Conversation
indykoning
reviewed
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ref: FW-2261
Previously, we relied on some heuristics to check whether a type needed to have a
.keywordor not in the ES query. However, this was unreliable. Specifically we ran into this with thecreated_atfield which in one of our projects was inexplicably set totextinstead ofdate.We could have just changed this one attribute, however I found 2 problems with that:
On the other hand, this solution also has some problems. We really need to rely on cache to not make all requests slow AF, so I've tried to make sure that the cache gets cleared and then warmed after every index. This will also not work well when there is no index yet, however that should be fine because without any indexed data the
.keywordisn't relevant anyway.For this solution I added two new events that are similar to the
IndexBeforeEvent/IndexAfterEventevents, that instead fire on a per-store basis. This allows me to clear and warm the cached mappings per store.