Skip to content
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

Close content gap for enabled mapping parameter #8548

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions _field-types/mapping-parameters/enabled.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: default
title: enabled
parent: Mapping parameters
grand_parent: Mapping and field types
nav_order: 40
has_children: false
has_toc: false
---

# Enabled

The `enabled` parameter allows you to control whether OpenSearch parses the contents of a field. This parameter can be applied to the top-level mapping definition and to object fields.

The `enabled` parameter accepts the following values.

Parameter | Description
:--- | :---
`true` | The field is parsed and indexed. Default is `true`.
`false` | The field is not parsed or indexed but is still retrievable from the `_source` field. When `enabled` is set to `false`, OpenSearch stores the field's value in the `_source` field but does not index or parse its contents. This can be useful for fields that you want to store but do not need to search, sort, or aggregate on.

---

## Example: Using the `enabled` parameter

In the following example request, the `session_data` field is disabled. OpenSearch stores its contents in the `_source` field but does not index or parse them:

```json
PUT my-index-002
{
"mappings": {
"properties": {
"user_id": {
"type": "keyword"
},
"last_updated": {
"type": "date"
},
"session_data": {
"type": "object",
"enabled": false
}
}
}
}
```
{% include copy-curl.html %}
Loading