Skip to content

Commit 464fc31

Browse files
authored
AbstractElasticsearchTemplate.searchForStream use Query scrolltime.
Original Pull Request #1951 Closes #1950
1 parent 175e7b5 commit 464fc31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/springframework/data/elasticsearch/core/AbstractElasticsearchTemplate.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
* @author Peter-Josef Meisch
7070
* @author Roman Puchkovskiy
7171
* @author Subhobrata Dey
72+
* @author Steven Pearce
7273
*/
7374
public abstract class AbstractElasticsearchTemplate implements ElasticsearchOperations, ApplicationContextAware {
7475

@@ -370,7 +371,8 @@ public <T> SearchHitsIterator<T> searchForStream(Query query, Class<T> clazz) {
370371
@Override
371372
public <T> SearchHitsIterator<T> searchForStream(Query query, Class<T> clazz, IndexCoordinates index) {
372373

373-
long scrollTimeInMillis = Duration.ofMinutes(1).toMillis();
374+
Duration scrollTime = query.getScrollTime() != null ? query.getScrollTime() : Duration.ofMinutes(1);
375+
long scrollTimeInMillis = scrollTime.toMillis();
374376
// noinspection ConstantConditions
375377
int maxCount = query.isLimiting() ? query.getMaxResults() : 0;
376378

0 commit comments

Comments
 (0)