elasticsearch/docs/reference/mapping/fields/ignored-field.asciidoc
eyalkoren ee262954ee
Adding aggregations support for the _ignored field (#101373)
Enables aggregations on the _ignored metadata field replacing the stored field
with doc values.
2024-04-29 16:41:34 +02:00

62 lines
1.7 KiB
Text

[[mapping-ignored-field]]
=== `_ignored` field
The `_ignored` field indexes and stores the names of every field in a document
that has been ignored when the document was indexed. This can, for example,
be the case when the field was malformed and <<ignore-malformed,`ignore_malformed`>>
was turned on, when a `keyword` field's value exceeds its optional
<<ignore-above,`ignore_above`>> setting, or when
<<mapping-settings-limit,`index.mapping.total_fields.limit`>> has been reached and
<<mapping-settings-limit,`index.mapping.total_fields.ignore_dynamic_beyond_limit`>>
is set to `true`.
This field is searchable with <<query-dsl-term-query,`term`>>,
<<query-dsl-terms-query,`terms`>> and <<query-dsl-exists-query,`exists`>>
queries, and is returned as part of the search hits.
For instance the below query matches all documents that have one or more fields
that got ignored:
[source,console]
--------------------------------------------------
GET _search
{
"query": {
"exists": {
"field": "_ignored"
}
}
}
--------------------------------------------------
Similarly, the below query finds all documents whose `@timestamp` field was
ignored at index time:
[source,console]
--------------------------------------------------
GET _search
{
"query": {
"term": {
"_ignored": "@timestamp"
}
}
}
--------------------------------------------------
Since 8.15.0, the `_ignored` field supports aggregations as well.
For example, the below query finds all fields that got ignored:
[source,console]
--------------------------------------------------
GET _search
{
"aggs": {
"ignored_fields": {
"terms": {
"field": "_ignored"
}
}
}
}
--------------------------------------------------