1
0

source-field.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. [[mapping-source-field]]
  2. === `_source`
  3. The `_source` field is an automatically generated field that stores the
  4. actual JSON that was used as the indexed document. It is not indexed
  5. (searchable), just stored. When executing "fetch" requests, like
  6. <<docs-get,get>> or
  7. <<search-search,search>>, the `_source` field is
  8. returned by default.
  9. Though very handy to have around, the source field does incur storage
  10. overhead within the index. For this reason, it can be disabled. For
  11. example:
  12. [source,js]
  13. --------------------------------------------------
  14. {
  15. "tweet" : {
  16. "_source" : {"enabled" : false}
  17. }
  18. }
  19. --------------------------------------------------
  20. [float]
  21. ==== Includes / Excludes
  22. Allow to specify paths in the source that would be included / excluded
  23. when it's stored, supporting `*` as wildcard annotation. For example:
  24. [source,js]
  25. --------------------------------------------------
  26. {
  27. "my_type" : {
  28. "_source" : {
  29. "includes" : ["path1.*", "path2.*"],
  30. "excludes" : ["pat3.*"]
  31. }
  32. }
  33. }
  34. --------------------------------------------------