-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Explain ignore_above
better
#129284
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
Explain ignore_above
better
#129284
Changes from 5 commits
5d6fc66
c1c509d
6f9f2bb
c3c7206
eaefb8d
36f91e8
0806dbd
3974e6c
89654f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -70,7 +70,21 @@ The following parameters are accepted by `keyword` fields: | ||||||||||
: 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. | |||||||||||
|
|||||||||||
[`ignore_above`](/reference/elasticsearch/mapping-reference/ignore-above.md) | |||||||||||
: 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`. | |||||||||||
: Do not index any field containing a string with more characters than this value. This is important because {{es}} | |||||||||||
will reject entire documents if they contain keyword fields that exceed `32766` bytes when UTF-8 encoded. | |||||||||||
|
|||||||||||
To avoid any risk of document rejection, set this value to `8191` or less. Fields with strings exceeding this | |||||||||||
length will be excluded from indexing. | |||||||||||
|
|||||||||||
The defaults are complicated: | |||||||||||
* Standard indices: `2147483647` (effectively unbounded). Documents containing `keyword` fields longer than `32766` | |||||||||||
bytes will be rejected. | |||||||||||
* `logsdb` indices: `8191`. `keyword` fields longer than `8191` characters won't be indexed, but the documents are | |||||||||||
accepted and the values unindexed values are available from `_source. | |||||||||||
|
Index type | Default | Effect |
---|---|---|
Standard indices | 2147483647 (effectively unbounded) |
Documents will be rejected if any keyword exceeds 32766 bytes. |
logsdb indices |
8191 |
Documents are never rejected. Keywords exceding this limit are still kept in _source , but won’t be searchable or aggregatable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see this is in definition list already, so maybe a table won't work. But if you like my wording you can update accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me like that wording :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "Documents are never rejected" might be a bit too strongly worded; maybe something like:
Documents won't be rejected if a keyword field exceeds this limit and the field will still be kept in
_source
, but it won’t be searchable or aggregatable.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part I struggle to understand. But it feels separate from the defaults above? Maybe this can be in a new paragraph. I think you're saying that...
When ES finds a new string field without an explicit mapping, it automatically:
- Maps the field to a text field so the entire value is searchable with full-text search.
- Adds a sub keyword field with
ignore_above
set to256
bytes. This means that values less than 256 bytes are available for exact matching over_search
. Values longer than that are still searchable via thetext
field, but are not indexed as keywords.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree I am a bit confused by the very last sentence in this paragraph.
@bmorelli25 I like your suggested rewrite, but I believe it should be "256
characters" not bytes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work on text fields? Or only keyword fields?
Also further down you say:
Does the previous statement only apply to logsdb indices? Or to standard indices as well? If both, that feels important.
What about this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting is only available on keyword fields. But on text fields some tokenizers can have a
max_token_length
setting which doesn't ignore but instead splits tokens that exceed this length (so quite a bit different)I think it might be a bit clearer to specify characters/bytes, like "UTF-8–encoded size of
32766
bytes." and "set this value to8191
characters or less."