New

The executive guide to generative AI

Read more
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.

_source

edit

The _source field is an automatically generated field that stores the actual JSON that was used as the indexed document. It is not indexed (searchable), just stored. When executing "fetch" requests, like get or search, the _source field is returned by default.

Though very handy to have around, the source field does incur storage overhead within the index. For this reason, it can be disabled. For example:

{
    "tweet" : {
        "_source" : {"enabled" : false}
    }
}

Includes / Excludes

edit

Allow to specify paths in the source that would be included / excluded when it’s stored, supporting * as wildcard annotation. For example:

{
    "my_type" : {
        "_source" : {
            "includes" : ["path1.*", "path2.*"],
            "excludes" : ["path3.*"]
        }
    }
}
Was this helpful?
Feedback