2014-05-20 11:34:00 -04:00
|
|
|
[[mapping-field-names-field]]
|
2015-07-19 19:24:29 -04:00
|
|
|
=== `_field_names` field
|
|
|
|
|
2018-06-04 04:17:11 -04:00
|
|
|
The `_field_names` field used to index the names of every field in a document that
|
|
|
|
contains any value other than `null`. This field was used by the
|
2015-12-11 14:07:57 -05:00
|
|
|
<<query-dsl-exists-query,`exists`>> query to find documents that
|
|
|
|
either have or don't have any non-+null+ value for a particular field.
|
2015-07-19 19:24:29 -04:00
|
|
|
|
2018-06-04 04:17:11 -04:00
|
|
|
Now the `_field_names` field only indexes the names of fields that have
|
|
|
|
`doc_values` and `norms` disabled. For fields which have either `doc_values`
|
|
|
|
or `norm` enabled the <<query-dsl-exists-query,`exists`>> query will still
|
|
|
|
be available but will not use the `_field_names` field.
|
2017-10-06 10:49:15 -04:00
|
|
|
|
|
|
|
==== Disabling `_field_names`
|
|
|
|
|
2018-06-04 04:17:11 -04:00
|
|
|
Disabling `_field_names` is often not necessary because it no longer
|
|
|
|
carries the index overhead it once did. If you have a lot of fields
|
|
|
|
which have `doc_values` and `norms` disabled and you do not need to
|
|
|
|
execute `exists` queries using those fields you might want to disable
|
|
|
|
`_field_names` be adding the following to the mappings:
|
2017-10-06 10:49:15 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2019-01-22 09:13:52 -05:00
|
|
|
PUT tweets
|
2017-10-06 10:49:15 -04:00
|
|
|
{
|
|
|
|
"mappings": {
|
2019-01-22 09:13:52 -05:00
|
|
|
"_field_names": {
|
|
|
|
"enabled": false
|
2017-10-06 10:49:15 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|