doc_values
By default, OpenSearch indexes most fields for search purposes. The doc_values
parameter enables document-to-term lookups for operations such as sorting, aggregations, and scripting.
The doc_values
parameter accepts the following options.
Option | Description |
---|---|
true | Enables doc_values for the field. Default is true . |
false | Disables doc_values for the field. |
The doc_values
parameter is not supported for use in text fields.
Example: Creating an index with doc_values
enabled and disabled
The following example request creates an index with doc_values
enabled for one field and disabled for another:
PUT my-index-001
{
"mappings": {
"properties": {
"status_code": {
"type": "keyword"
},
"session_id": {
"type": "keyword",
"doc_values": false
}
}
}
}
copy
当前内容版权归 OpenSearch 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 OpenSearch .