|
1 | 1 | [[scroll_examples]] |
2 | 2 | === Scroll |
3 | 3 |
|
4 | | -While a search request returns a single “page” of results, the scroll API can be |
5 | | -used to retrieve large numbers of results (or even all results) from a single |
6 | | -search request, in much the same way as you would use a cursor on a traditional |
| 4 | +While a search request returns a single “page” of results, the scroll API can be |
| 5 | +used to retrieve large numbers of results (or even all results) from a single |
| 6 | +search request, in much the same way as you would use a cursor on a traditional |
7 | 7 | database. |
8 | 8 |
|
9 | | -Scrolling is not intended for real time user requests, but rather for processing |
10 | | -large amounts of data, for example in order to reindex the contents of one index |
| 9 | +Scrolling is not intended for real time user requests, but rather for processing |
| 10 | +large amounts of data, for example in order to reindex the contents of one index |
11 | 11 | into a new index with a different configuration. |
12 | 12 |
|
13 | | -NOTE: The results that are returned from a scroll request reflect the state of |
14 | | -the index at the time that the initial search request was made, like a snapshot |
15 | | -in time. Subsequent changes to documents (index, update or delete) will only |
| 13 | +NOTE: The results that are returned from a scroll request reflect the state of |
| 14 | +the index at the time that the initial search request was made, like a snapshot |
| 15 | +in time. Subsequent changes to documents (index, update or delete) will only |
16 | 16 | affect later search requests. |
17 | 17 |
|
18 | | -In order to use scrolling, the initial search request should specify the scroll |
19 | | -parameter in the query string, which tells {es} how long it should keep the |
| 18 | +In order to use scrolling, the initial search request should specify the scroll |
| 19 | +parameter in the query string, which tells {es} how long it should keep the |
20 | 20 | “search context” alive. |
21 | 21 |
|
22 | | -NOTE: Did you know that we provide an helper for sending scroll requests? You can find it {jsclient}/client-helpers.html[here]. |
| 22 | +NOTE: Did you know that we provide an helper for sending scroll requests? You can find it <<scroll-search-helper,here>>. |
23 | 23 |
|
24 | 24 | [source,js] |
25 | 25 | ---- |
@@ -113,7 +113,7 @@ async function run () { |
113 | 113 | run().catch(console.log) |
114 | 114 | ---- |
115 | 115 |
|
116 | | -Another cool usage of the `scroll` API can be done with Node.js ≥ 10, by using |
| 116 | +Another cool usage of the `scroll` API can be done with Node.js ≥ 10, by using |
117 | 117 | async iteration! |
118 | 118 |
|
119 | 119 | [source,js] |
|
0 commit comments