Skip to content

Commit 21ade25

Browse files
authored
DATAES-802 - Update documentation for using scroll API with repository methods.
Original PR: spring-projects#440
1 parent a4ec819 commit 21ade25

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/asciidoc/reference/elasticsearch-misc.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ while (scroll.hasSearchHits()) {
8080
template.searchScrollClear(scrollId);
8181
----
8282

83+
Additionally, the scroll API can be used by defining the return type as `Stream` in the Elasticsearch Repository.
84+
85+
[source,java]
86+
----
87+
interface SampleEntityRepository extends Repository<SampleEntity, String> {
88+
89+
Stream<SampleEntity> findBy();
90+
91+
}
92+
----
93+
8394
[[elasticsearch.misc.sorts]]
8495
== Sort options
8596

0 commit comments

Comments
 (0)