-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Reduce the number of calls to document() from LeafStoredFieldsLookup #66928
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-search (Team:Search) |
The idea here is that in future SourceLookup can depend on LeafStoredFieldsLookup to load its values, allowing us to consolidate loading source and stored fields together in a single place rather than spread across the Fetch phase. |
I still need to ponder the refactor in detail, but had some initial thoughts.
It's rare for scripts to access stored fields, and in general we hope to decrease reliance on stored fields (maybe eventually deprecating them?) So this refactor doesn't feel high priority in itself. However you mention that this is an incremental step towards having
I see these |
@elasticmachine update branch |
Hi Team, |
LeafStoredFieldsLookup currently uses a SingleFieldsVisitor to load values, which
will be inefficient if a script references more than one stored field. This commit
refactors the lookup to remember all the fields that are requested, along with the
ability to pre-register fields so that the first lookup will also only read from disk
once.
Relates to #66256