You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Elasticsearch has a scroll API for getting big result set in chunks. `ElasticsearchOperations` has startScroll and continueScroll methods that can be used as below.
30
+
Elasticsearch has a scroll API for getting big result set in chunks. This is internally used by Spring Data Elasticsearch to provide the implementations of the `<T> SearchHitsIterator<T> SearchOperations.searchForStream(Query query, Class<T> clazz, IndexCoordinates index)` method.
31
31
32
-
.Using startScroll and continueScroll
33
-
====
34
32
[source,java]
35
33
----
36
34
IndexCoordinates index = IndexCoordinates.of("sample-index");
@@ -43,25 +41,23 @@ SearchQuery searchQuery = new NativeSearchQueryBuilder()
`ElasticsearchOperations` additionally has the stream method which wraps the scan and scroll operations into a CloseableIterator.
54
+
There are no methods in the `SearchOperations` API to access the scroll id, if it should be necessary to access this, the following methods of the `ElasticsearchRestTemplate` can be used:
60
55
61
-
.Using stream
62
-
====
63
56
[source,java]
64
57
----
58
+
59
+
@Autowired ElasticsearchRestTemplate template;
60
+
65
61
IndexCoordinates index = IndexCoordinates.of("sample-index");
66
62
67
63
SearchQuery searchQuery = new NativeSearchQueryBuilder()
@@ -72,14 +68,17 @@ SearchQuery searchQuery = new NativeSearchQueryBuilder()
0 commit comments