-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ValueFetchers now return a StoredFieldsSpec #94820
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
Merged
romseygeek
merged 7 commits into
elastic:main
from
romseygeek:value-fetcher/stored-fields-spec
Mar 30, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9cce283
ValueFetchers now return a StoredFieldsSpec
romseygeek 4be2a8e
compile
romseygeek 5626bf5
better testing of preloadedfieldlookupprovider
romseygeek 81d076c
Merge remote-tracking branch 'origin/main' into value-fetcher/stored-…
romseygeek cfd6e88
better test; actually use the damn thing; runtime fields need to load…
romseygeek ca1d919
sake
romseygeek dbec7a7
Merge branch 'main' into value-fetcher/stored-fields-spec
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| import org.elasticsearch.index.fielddata.FormattedDocValues; | ||
| import org.elasticsearch.index.fielddata.IndexFieldData; | ||
| import org.elasticsearch.search.DocValueFormat; | ||
| import org.elasticsearch.search.fetch.StoredFieldsSpec; | ||
| import org.elasticsearch.search.lookup.Source; | ||
|
|
||
| import java.io.IOException; | ||
|
|
@@ -23,14 +24,22 @@ | |
| /** | ||
| * Value fetcher that loads from doc values. | ||
| */ | ||
| // TODO rename this? It doesn't load from doc values, it loads from fielddata | ||
| // Which might be doc values, but might not be... | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, so |
||
| public final class DocValueFetcher implements ValueFetcher { | ||
| private final DocValueFormat format; | ||
| private final IndexFieldData<?> ifd; | ||
| private FormattedDocValues formattedDocValues; | ||
| private final StoredFieldsSpec storedFieldsSpec; | ||
|
|
||
| public DocValueFetcher(DocValueFormat format, IndexFieldData<?> ifd) { | ||
| public DocValueFetcher(DocValueFormat format, IndexFieldData<?> ifd, StoredFieldsSpec storedFieldsSpec) { | ||
| this.format = format; | ||
| this.ifd = ifd; | ||
| this.storedFieldsSpec = storedFieldsSpec; | ||
| } | ||
|
|
||
| public DocValueFetcher(DocValueFormat format, IndexFieldData<?> ifd) { | ||
| this(format, ifd, StoredFieldsSpec.NO_REQUIREMENTS); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -50,4 +59,8 @@ public List<Object> fetchValues(Source source, int doc, List<Object> ignoredValu | |
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public StoredFieldsSpec storedFieldsSpec() { | ||
| return storedFieldsSpec; | ||
| } | ||
| } | ||
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Just for my curiosity, Was this call (#valueForDisplay) not necessary?
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.
It's moved into FieldLookup.setValues(), mainly because there are now two paths that can set it (here in the stored fields provider and also in the fetchphase pre-loaded implementation)