From f6b7ac2bf7919da9eb689f03c962bed932bd5618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Tue, 23 Oct 2018 13:03:00 +0200 Subject: [PATCH 1/2] document the search context is freed if the scroll is not extended The `fetchPhaseShouldFreeContext` returns true when there is a scroll context but the scroll parameter is null, thus freeing the search context. https://github.com/elastic/elasticsearch/blob/183c32d4c39948e037a7fb44dccf31ab0d60d3c3/server/src/main/java/org/elasticsearch/search/SearchService.java#L491 --- docs/reference/search/request/scroll.asciidoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference/search/request/scroll.asciidoc b/docs/reference/search/request/scroll.asciidoc index d7205228f7517..cbb98c496ae67 100644 --- a/docs/reference/search/request/scroll.asciidoc +++ b/docs/reference/search/request/scroll.asciidoc @@ -109,7 +109,8 @@ request) tells Elasticsearch how long it should keep the search context alive. Its value (e.g. `1m`, see <>) does not need to be long enough to process all data -- it just needs to be long enough to process the previous batch of results. Each `scroll` request (with the `scroll` parameter) sets a -new expiry time. +new expiry time. If the `scroll` parameter is not passed, then the next +scroll request will close the search context. Normally, the background merge process optimizes the index by merging together smaller segments to create new bigger segments, at From 7776151993aea04274fa34680c6f2b85d67e7bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Campinas?= Date: Thu, 25 Oct 2018 20:43:20 +0200 Subject: [PATCH 2/2] improved wording as per suggestion --- docs/reference/search/request/scroll.asciidoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/reference/search/request/scroll.asciidoc b/docs/reference/search/request/scroll.asciidoc index cbb98c496ae67..7fd0dd46cbc6f 100644 --- a/docs/reference/search/request/scroll.asciidoc +++ b/docs/reference/search/request/scroll.asciidoc @@ -109,8 +109,9 @@ request) tells Elasticsearch how long it should keep the search context alive. Its value (e.g. `1m`, see <>) does not need to be long enough to process all data -- it just needs to be long enough to process the previous batch of results. Each `scroll` request (with the `scroll` parameter) sets a -new expiry time. If the `scroll` parameter is not passed, then the next -scroll request will close the search context. +new expiry time. If a `scroll` request doesn't pass in the `scroll` +parameter, then the search context will be freed as part of _that_ `scroll` +request. Normally, the background merge process optimizes the index by merging together smaller segments to create new bigger segments, at