-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Meta] Better handling of single-valued fields #80825
Labels
>enhancement
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
Comments
markharwood
added
>enhancement
:Search/Search
Search-related issues that do not fall into other categories
labels
Nov 18, 2021
Pinging @elastic/es-search (Team:Search) |
Some thoughts on this proposal:
|
This was referenced May 1, 2023
javanna
added
:Search Foundations/Mapping
Index mappings, including merging and defining field types
and removed
:Search/Search
Search-related issues that do not fall into other categories
labels
Jul 17, 2024
elasticsearchmachine
added
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
and removed
Team:Search
Meta label for search team
labels
Jul 17, 2024
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
>enhancement
:Search Foundations/Mapping
Index mappings, including merging and defining field types
Team:Search Foundations
Meta label for the Search Foundations team in Elasticsearch
Background
For a long time elasticsearch has been very permissive about JSON documents and has made no distinction between single values and arrays of values. This permissive approach has several downsides:
OS:ios
andOS:android
simultaneouslyAll of the above is unfortunate because the majority of fields in common use are single-valued. A weblog's fields are a good example (timestamp, IP, OS, user agent, URL, referrer, country etc are all single values).
Proposed changes
The solution is a 2-pronged approach :
Enforcement: for new indices we can give administrators the option of rejecting documents with multiple-values.
Reporting: for both new and old indices we can report if the index contains only documents with single values
is_single_valued
flag to field caps output which indicates if all documents have single values for a field Field caps api - report back if fields are single-valued or not. #80730boolean allowsMultipleValues()
method to FieldMapper and remove existing validation code in single-valued fields that is slow. The DocumentParser class should instead assume responsibility for checking single-valued fields don't receive multiple valuesallow_multiple_values
flag to field mappings that can reject documents presenting arrays New field mapping flag - allow_multiple_values #80289allow_multiple_values
field mapping is set and we know this is enforced at ingest timeallow_multiple_values
is set to false (using NumericDocValuesField instead of SortedNumericDocValuesField and SortedDocValuesField instead of SortedSetDocValuesField)is_single_valued
feedback in field-caps (e.g. not ANDing values from this field in filter pills). Mention of related progress hereThe text was updated successfully, but these errors were encountered: