[Backport 7.x] Use filter_path for improving the search helpers performances (#1201)

This commit is contained in:
github-actions[bot]
2020-05-25 14:26:58 +02:00
committed by GitHub
parent 8a1e9576aa
commit 35e587663c
4 changed files with 105 additions and 10 deletions

View File

@ -212,7 +212,8 @@ console.log(result)
----
=== Search Helper
A simple wrapper around the search API. Instead of returning the entire `result` object it will return only the search documents result.
A simple wrapper around the search API. Instead of returning the entire `result` object it will return only the search documents source.
For improving the performances, this helper automatically adds `filter_path=hits.hits._source` to the querystring.
[source,js]
----
@ -281,6 +282,7 @@ for await (const result of scrollSearch) {
=== Scroll Documents Helper
It works in the same way as the scroll search helper, but it returns only the documents instead. Note, every loop cycle will return you a single document, and you can't use the `clear` method.
For improving the performances, this helper automatically adds `filter_path=hits.hits._source` to the querystring.
[source,js]
----