field-names-field.asciidoc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. [[mapping-field-names-field]]
  2. === `_field_names` field
  3. The `_field_names` field used to index the names of every field in a document that
  4. contains any value other than `null`. This field was used by the
  5. <<query-dsl-exists-query,`exists`>> query to find documents that
  6. either have or don't have any non-+null+ value for a particular field.
  7. Now the `_field_names` field only indexes the names of fields that have
  8. `doc_values` and `norms` disabled. For fields which have either `doc_values`
  9. or `norm` enabled the <<query-dsl-exists-query,`exists`>> query will still
  10. be available but will not use the `_field_names` field.
  11. [[disable-field-names]]
  12. ==== Disabling `_field_names`
  13. NOTE: Disabling `_field_names` has been deprecated and will be removed in a future major version.
  14. Disabling `_field_names` is usually not necessary because it no longer
  15. carries the index overhead it once did. If you have a lot of fields
  16. which have `doc_values` and `norms` disabled and you do not need to
  17. execute `exists` queries using those fields you might want to disable
  18. `_field_names` by adding the following to the mappings:
  19. [source,console]
  20. --------------------------------------------------
  21. PUT tweets
  22. {
  23. "mappings": {
  24. "_field_names": {
  25. "enabled": false
  26. }
  27. }
  28. }
  29. --------------------------------------------------
  30. // TEST[warning:Index [tweets] uses the deprecated `enabled` setting for `_field_names`. Disabling _field_names is not necessary because it no longer carries a large index overhead. Support for this setting will be removed in a future major version. Please remove it from your mappings and templates.]