-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Closed
Copy link
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>docsGeneral docs changesGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
The mapper size plugin documentation notes that the _size field can be retrieved using script_fields like so:
"script_fields": {
"size": {
"script": "doc['_size']"
}
}
An alternative is to use docvalue_fields like so:
"docvalue_fields" : [
{
"field": "_size",
"format": "use_field_mapping"
}
]
This second option is helpful for situations where users may have dynamic scripting disabled. I'm not sure, but it my also perform better than the script fields option.
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>docsGeneral docs changesGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch