Skip to content

Commit ab2263a

Browse files
updating the source removal details (#11140) (#11151)
1 parent 03f4aae commit ab2263a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

_field-types/metadata-fields/source.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ PUT sample-index1
7474
```
7575
{% include copy-curl.html %}
7676

77-
While skipping the `_source` field can significantly reduce storage requirements, dynamically deriving the source is generally slower than reading a stored `_source`. To avoid this overhead during search queries, do not request the `_source` field when it's not needed. You can do this by setting the `size` parameter, which controls the number of documents returned.
77+
While skipping the `_source` field can significantly reduce storage requirements, dynamically deriving the source is generally slower than reading a stored `_source`. To avoid this overhead during search queries, do not request the `_source` field when it's not needed. You can do this in the search query by setting the `_source` parameter to `false` (demonstrated in the following example) or providing a list of `include` and `exclude` fields:
78+
79+
```json
80+
GET sample-index1/_search
81+
{
82+
"_source": false,
83+
"query": { "match_all": {} }
84+
}
85+
```
86+
{% include copy-curl.html %}
7887

7988
For real-time reads using the [Get Document API]({{site.url}}{{site.baseurl}}/api-reference/document-apis/get-documents/) or [Multi-get Documents API]({{site.url}}{{site.baseurl}}/api-reference/document-apis/multi-get/), which are served from the translog until [`refresh`]({{site.url}}{{site.baseurl}}/api-reference/index-apis/refresh/) happens, performance can be slower when using a derived source. This is because the document must first be ingested temporarily before the source can be reconstructed. You can avoid this additional latency by using an index-level `derived_source.translog` setting that disables generating a derived source during translog reads:
8089

0 commit comments

Comments
 (0)