-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Support unmapped fields in search 'fields' option. #63690
Comments
Pinging @elastic/es-search (:Search/Search) |
Recently, we've had a request in discuss about something tangential to supporting unmapped fields in SQL (implicitly the |
Currently, the 'fields' option only supports fetching mapped fields. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading unmapped values. This change adds implementation and tests for this addition. Closes elastic#63690
The current WIP is out at #64651, so I want to summarize the currently propsed implementation details for better visibility here: APIAfter some indivudual discussion I think we should opt for not returning unmapped fields by default, but instead rely on a per-pattern flag Example:
would return all mapped fields (“”) and all unmapped fields under “obj.” Return formatUnmapped fields under an inner object that has
would return (the same that same output that would be returned for
Also, like when currently using Some edge casesHandling values dropped due to “ignore_malformed”When mapped fields discard malformed values due to Don’t return
|
Currently, the 'fields' option only supports fetching mapped fields. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading unmapped values. This change adds implementation and tests for this feature. Closes elastic#63690
Currently, the 'fields' option only supports fetching mapped fields. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading unmapped values. This change adds implementation and tests for this feature. Closes #63690
Currently, the 'fields' option only supports fetching mapped fields. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading unmapped values. This change adds implementation and tests for this feature. Closes elastic#63690
Currently, the 'fields' option only supports fetching mapped fields. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading unmapped values. This change adds implementation and tests for this feature. Closes #63690
We recommend omitting a field from the mappings when a user wants to avoid the indexing overhead, but still retrieve its values. This is usually accomplished by using an
object
field withenabled: false
ordynamic: false
. Since 'fields' is meant to be the central place to retrieve document content, it should allow for loading these unmapped values.Longer-term we'd like to discourage users from having unmapped fields, and instead introduce lightweight ways to map data without indexing it. But in the meantime, we think it's valuable to support unmapped fields.
One proposal is to add a flag
include_unmapped
:When
include_unmapped
is specified, the 'fields' option would do the following:The flag could default to 'false', and eventually be phased out as it becomes less common to have unmapped fields.
Some questions to consider:
The text was updated successfully, but these errors were encountered: