Add support for source_path to the field caps API. #52345
Closed
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.
This PR contains a draft of adding
_source
path information to the field caps API. It implements the API addition described in #49264 (comment). This addition focuses on the SQL and ML use case of looking up values through_source
. (Kibana may also want to use source path information to better support field aliases -- we're still working on defining their use case + requirements.)Some notes on the design:
_source
.copy_to
.It would be great to get feedback on these notes. I’m curious if/ how we currently handle
copy_to
when looking up fields in SQL and ML, and if the current design is a good fit. Supportingcopy_to
did make the API + implementation a bit more complex, since each field can have multiple source paths.Other implementation notes:
MapperService#sourcePath
. Tracking source path information withinMapperService
lets us avoid scanning over all the mappings on each call to field caps, and also makes the information available to other search components (maybe it could be useful to highlighting?)Addresses #49264.