Skip to content

Commit 2083ef8

Browse files
authored
Clarify doc values (elastic#123309) (elastic#123371)
1 parent 04085e2 commit 2083ef8

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

docs/reference/mapping/params/doc-values.asciidoc

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ different data access pattern. Instead of looking up the term and finding
1111
documents, we need to be able to look up the document and find the terms that
1212
it has in a field.
1313

14-
Doc values are the on-disk data structure, built at document index time, which
15-
makes this data access pattern possible. They store the same values as the
16-
`_source` but in a column-oriented fashion that is way more efficient for
17-
sorting and aggregations. Doc values are supported on almost all field types,
18-
with the __notable exception of `text` and `annotated_text` fields__.
14+
The `doc_values` field is an on-disk data structure that is built at index time and
15+
enables efficient data access. It stores the same values as
16+
`_source`, but in a column-oriented format that is more efficient for
17+
sorting and aggregations.
18+
19+
Doc values are supported on most field types,
20+
excluding `text` and `annotated_text` fields. See also <<doc-values-disable>>.
1921

2022
[[doc-value-only-fields]]
2123
==== Doc-value-only fields
@@ -55,11 +57,17 @@ PUT my-index-000001
5557
<2> The `session_id` field has `index` disabled, and is therefore a
5658
doc-value-only long field as doc values are enabled by default.
5759

60+
[[doc-values-disable]]
5861
==== Disabling doc values
5962

60-
All fields which support doc values have them enabled by default. If you are
61-
sure that you don't need to sort or aggregate on a field, or access the field
62-
value from a script, you can disable doc values in order to save disk space:
63+
For all fields that support them, `doc_values` are enabled by default. In
64+
some field types, such as <<search-as-you-type,`search_as_you_type`>>,
65+
`doc_values` appear in API responses but can't be configured. Setting
66+
`doc_values` for these fields might result in an error or have no effect.
67+
68+
If you're
69+
certain you don't need to sort or aggregate on a field or access its
70+
value from a script, you can disable `doc_values` in order to save disk space:
6371

6472
[source,console]
6573
--------------------------------------------------

0 commit comments

Comments
 (0)