Skip to content

Commit

Permalink
document the search context is freed if the scroll is not extended (#…
Browse files Browse the repository at this point in the history
…34739)

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
  • Loading branch information
scampi authored and nik9000 committed Oct 25, 2018
1 parent 59df6e8 commit 27c4d63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/reference/search/request/scroll.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ request) tells Elasticsearch how long it should keep the search context alive.
Its value (e.g. `1m`, see <<time-units>>) 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 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
Expand Down

0 comments on commit 27c4d63

Please sign in to comment.