WARNING: Version 2.4 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
include_in_all
editinclude_in_all
editThe include_in_all parameter provides per-field control over which fields
are included in the _all field. It defaults to true, unless index is set to no.
This example demonstrates how to exclude the date field from the _all field:
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"title": {
"type": "string"
}
"content": {
"type": "string"
},
"date": {
"type": "date",
"include_in_all": false
}
}
}
}
}
|
The |
|
|
The |
The include_in_all setting is allowed to have different settings for
fields of the same name in the same index. Its value can be updated on
existing fields using the PUT mapping API.
The include_in_all parameter can also be set at the type level and on
object or nested fields, in which case all sub-
fields inherit that setting. For instance:
PUT my_index
{
"mappings": {
"my_type": {
"include_in_all": false,
"properties": {
"title": { "type": "string" },
"author": {
"include_in_all": true,
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string" }
}
},
"editor": {
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string", "include_in_all": true }
}
}
}
}
}
}
|
All fields in |
|
|
The |
|
|
Only the |
Multi-fields and include_in_all
The original field value is added to the _all field, not the terms produced
by a field’s analyzer. For this reason, it makes no sense to set
include_in_all to true on multi-fields, as each
multi-field has exactly the same value as its parent.