field-names-field.asciidoc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. ==== Disabling `_field_names`
  12. Disabling `_field_names` is often not necessary because it no longer
  13. carries the index overhead it once did. If you have a lot of fields
  14. which have `doc_values` and `norms` disabled and you do not need to
  15. execute `exists` queries using those fields you might want to disable
  16. `_field_names` be adding the following to the mappings:
  17. [source,js]
  18. --------------------------------------------------
  19. PUT tweets
  20. {
  21. "mappings": {
  22. "_doc": {
  23. "_field_names": {
  24. "enabled": false
  25. }
  26. }
  27. }
  28. }
  29. --------------------------------------------------
  30. // CONSOLE