Skip to content

Commit 5d6fc66

Browse files
committed
Explain ignore_above better
This concept is complicated. Closes #128991
1 parent 6370d60 commit 5d6fc66

File tree

1 file changed

+9
-1
lines changed
  • docs/reference/elasticsearch/mapping-reference

1 file changed

+9
-1
lines changed

docs/reference/elasticsearch/mapping-reference/keyword.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ The following parameters are accepted by `keyword` fields:
7070
: Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one field for search and a multi-field for sorting and aggregations.
7171

7272
[`ignore_above`](/reference/elasticsearch/mapping-reference/ignore-above.md)
73-
: Do not index any string longer than this value. Defaults to `2147483647` in standard indices so that all values would be accepted, and `8191` in logsdb indices to protect against Lucene's term byte-length limit of `32766`. Please however note that default dynamic mapping rules create a sub `keyword` field that overrides this default by setting `ignore_above: 256`.
73+
: Do not index any string with more characters than this value. This is important because `keyword`
74+
fields will reject documents with `keyword` fields that encode to utf-8 longer than `32766` bytes.
75+
If you need to never reject documents, this should have some value `<=8191`. All documents with
76+
more characters will just skip building the index for this field.
77+
The defaults are complicated. It's `2147483647` (effectively unbounded) in standard indices and
78+
`8191` in logsdb indices. So, if unspecified, standard indices *can* reject documents. And logsdb indices
79+
will index the document, but skip this field.
80+
The [dynamic mapping](docs-content://manage-data/data-store/mapping/dynamic-mapping.md) for string fields
81+
defaults to a `text` field with a sub-`keyword` field with an `ignore_above` of `256`.
7482

7583
[`index`](/reference/elasticsearch/mapping-reference/mapping-index.md)
7684
: Should the field be quickly searchable? Accepts `true` (default) and `false`. `keyword` fields that only have [`doc_values`](/reference/elasticsearch/mapping-reference/doc-values.md) enabled can still be queried, albeit slower.

0 commit comments

Comments
 (0)