_field_names field

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/mapping-field-names-field.html

译文链接 : http://www.apache.wiki/display/Elasticsearch/_field_names+field

贡献者 : 朱彦安ApacheCNApache中文网

_field_names字段索引包含除 null 之外的任何值的文档中每个字段的名称。 该字段通过 exists 查询以查找特定字段具有或不具有任何非空值的文档。

_field_names字段的值可以在查询中被访问:

  1. # Example documents
  2. PUT my_index/my_type/1
  3. {
  4. "title": "This is a document"
  5. }
  6. PUT my_index/my_type/2?refresh=true
  7. {
  8. "title": "This is another document",
  9. "body": "This document has a body"
  10. }
  11. GET my_index/_search
  12. {
  13. "query": {
  14. "terms": {
  15. "_field_names": [ "title" ] # 1
  16. }
  17. }
  18. }

| 1 | 在 _field_names 字段上查询(参考 exists 查询) |