Link Search Menu Expand Document Documentation Menu

You're viewing version 2.18 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

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
      }
    }
  }
}

350 characters left

Have a question? .

Want to contribute? or .