OpenSearch/docs/reference/mapping/fields/field-names-field.asciidoc

37 lines
1.5 KiB
Plaintext

[[mapping-field-names-field]]
=== `_field_names` field
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
<<query-dsl-exists-query,`exists`>> query to find documents that
either have or don't have any non-+null+ value for a particular field.
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.
[[disable-field-names]]
==== Disabling `_field_names`
NOTE: Disabling `_field_names` has been deprecated and will be removed in a future major version.
Disabling `_field_names` is usually 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` by adding the following to the mappings:
[source,console]
--------------------------------------------------
PUT tweets
{
"mappings": {
"_field_names": {
"enabled": false
}
}
}
--------------------------------------------------
// TEST[warning:Disabling _field_names is not necessary because it no longer carries a large index overhead. Support for the `enabled` setting will be removed in a future major version. Please remove it from your mappings and templates.]