What do you want to do?
Tell us about your request
Add documentation for the derived_source_keep field mapping parameter that controls source reconstruction for derived fields.
This parameter has two modes:
none (default): Uses doc values for source reconstruction. Doc values deduplicate values and may reorder arrays.
arrays: Enables stored fields to preserve exact array structures, including original order and duplicate values.
Documentation should cover:
- Configuration syntax.
- Supported field types:
keyword
boolean
ip
- Numeric (
long, integer, short, byte, double, float, half_float)
date
- Behavior differences between modes.
- Usage examples demonstrating preservation of array order and duplicates.
Version
3.8.0+
What other resources are available?
Steps for Testing
1. Create an index with derived_source_keep
PUT /test-index
{
"mappings": {
"properties": {
"tags": {
"type": "keyword",
"derived_source_keep": "arrays"
}
}
}
}
2. Index a document containing an array
POST /test-index/_doc/1
{
"tags": [
"opensearch",
"search",
"opensearch",
"analytics",
"search"
]
}
3. Retrieve the document
Expected Result
The tags array should preserve its original structure and ordering:
{
"_source": {
"tags": [
"opensearch",
"search",
"opensearch",
"analytics",
"search"
]
}
}
Verification: The array maintains its original order and preserves duplicate values (opensearch appears twice and search appears twice).
Key Points for Documentation
- When
derived_source_keep: "arrays" is set, the field automatically enables store: true.
- This increases index size but preserves exact array semantics.
- This option is essential for use cases requiring exact array order and duplicate preservation.
What do you want to do?
Tell us about your request
Add documentation for the
derived_source_keepfield mapping parameter that controls source reconstruction for derived fields.This parameter has two modes:
none(default): Uses doc values for source reconstruction. Doc values deduplicate values and may reorder arrays.arrays: Enables stored fields to preserve exact array structures, including original order and duplicate values.Documentation should cover:
keywordbooleaniplong,integer,short,byte,double,float,half_float)dateVersion
3.8.0+What other resources are available?
Steps for Testing
1. Create an index with
derived_source_keep2. Index a document containing an array
3. Retrieve the document
Expected Result
The
tagsarray should preserve its original structure and ordering:{ "_source": { "tags": [ "opensearch", "search", "opensearch", "analytics", "search" ] } }Verification: The array maintains its original order and preserves duplicate values (
opensearchappears twice andsearchappears twice).Key Points for Documentation
derived_source_keep: "arrays"is set, the field automatically enablesstore: true.