Skip to content

Commit bea3af2

Browse files
authored
[DOCS] Clarify support for doc_values (#124047)
* Update doc-values.md * Make the note more visible * fix link
1 parent 3a472eb commit bea3af2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

docs/reference/elasticsearch/mapping-reference/doc-values.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Most fields are [indexed](/reference/elasticsearch/mapping-reference/mapping-ind
99

1010
Sorting, aggregations, and access to field values in scripts requires a different data access pattern. Instead of looking up the term and finding documents, we need to be able to look up the document and find the terms that it has in a field.
1111

12-
Doc values are the on-disk data structure, built at document index time, which makes this data access pattern possible. They store the same values as the `_source` but in a column-oriented fashion that is way more efficient for sorting and aggregations. Doc values are supported on almost all field types, with the *notable exception of `text` and `annotated_text` fields*.
12+
The `doc_values` field is an on-disk data structure that is built at document index time and enables efficient data access. It stores the same values as `_source`, but in a columnar format that is more efficient for sorting and aggregation.
13+
14+
Doc values are supported on most field types, excluding `text` and `annotated_text` fields. See also [Disabling doc values](#_disabling_doc_values).
1315

1416
## Doc-value-only fields [doc-value-only-fields]
1517

@@ -41,7 +43,15 @@ PUT my-index-000001
4143

4244
## Disabling doc values [_disabling_doc_values]
4345

44-
All fields which support doc values have them enabled by default. If you are sure that you don’t need to sort or aggregate on a field, or access the field value from a script, you can disable doc values in order to save disk space:
46+
For all fields that support them, `doc_values` are enabled by default. If you're certain you don't need to sort or aggregate on a field, or access its value from a script, you can disable `doc_values` in order to save disk space.
47+
48+
::::{note}
49+
You cannot disable doc values for [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields.
50+
51+
In some field types, such as [`search_as_you_type`](/reference/elasticsearch/mapping-reference/search-as-you-type.md), doc values appear in API responses but can't be configured. Enabling or disabling `doc_values` for these fields might result in an error or have no effect.
52+
::::
53+
54+
In the following example, `doc_values` is disabled on one field:
4555

4656
```console
4757
PUT my-index-000001
@@ -64,9 +74,7 @@ PUT my-index-000001
6474
2. The `session_id` has `doc_values` disabled, but can still be queried.
6575

6676

67-
::::{note}
68-
You cannot disable doc values for [`wildcard`](/reference/elasticsearch/mapping-reference/keyword.md#wildcard-field-type) fields.
69-
::::
77+
7078

7179

7280

0 commit comments

Comments
 (0)