Skip to content

Commit 6ed50e1

Browse files
nik9000limotovaleemthompo
authored
Explain ignore_above better (elastic#129284)
This concept is complicated. Closes elastic#128991 Co-authored-by: Larisa Motova <[email protected]> Co-authored-by: Liam Thompson <[email protected]>
1 parent 56477d8 commit 6ed50e1

File tree

1 file changed

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

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,19 @@ 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 field containing a string with more characters than this value. This is important because {{es}}
74+
will reject entire documents if they contain keyword fields that exceed `32766` UTF-8 encoded bytes.
75+
76+
To avoid any risk of document rejection, set this value to `8191` or less. Fields with strings exceeding this
77+
length will be excluded from indexing.
78+
79+
The defaults are complicated:
80+
81+
| Index type | Default | Effect |
82+
| ---------- | ------- | ------ |
83+
| Standard indices | `2147483647` (effectively unbounded) | Documents will be rejected if this keyword exceeds `32766` UTF-8 encoded bytes. |
84+
| `logsdb` indices | `8191` | This `keyword` field will never cause documents to be rejected. If this field is longer than `8191` characters it won't be indexed but its values are still available from `_source`. |
85+
| [dynamic mapping](docs-content://manage-data/data-store/mapping/dynamic-mapping.md) for string fields | `text` field with a [sub](/reference/elasticsearch/mapping-reference/multi-fields.md)-`keyword` field with an `ignore_above` of `256` | All string fields are available. Values longer than 256 characters are only available for full text search and won't have a value in their `.keyword` sub-field, so they can not be used for exact matching over _search. |
7486

7587
[`index`](/reference/elasticsearch/mapping-reference/mapping-index.md)
7688
: 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)