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

Clarify SourceLookup sharing across fetch subphases. #60484

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

jtibshirani
Copy link
Contributor

Backport of #60179.

The `SourceLookup` class provides access to the _source for a particular
document, specified through `SourceLookup#setSegmentAndDocument`. Previously
the search context contained a single `SourceLookup` that was shared between
different fetch subphases. It was hard to reason about its state: is
`SourceLookup` set to the expected document? Is the _source already loaded and
available?

Instead of using a global source lookup, the fetch hit context now provides
access to a lookup that is set to load from the hit document.

This refactor closes elastic#31000, since the same `SourceLookup` is no longer shared
between the 'fetch _source phase' and script execution.
@jtibshirani jtibshirani added >bug :Search/Search Search-related issues that do not fall into other categories >refactoring backport labels Jul 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 30, 2020
@jtibshirani jtibshirani merged commit dfd7f22 into elastic:7.x Jul 30, 2020
@jtibshirani jtibshirani deleted the source-lookup branch July 30, 2020 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport >bug >refactoring :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants