Skip to content

Commit 2b34336

Browse files
committed
Fixed the scroll to lazy load.
1 parent 6510e74 commit 2b34336

File tree

1 file changed

+2
-2
lines changed
  • elasticsearch4s/src/main/scala/jp/co/bizreach/elasticsearch4s

1 file changed

+2
-2
lines changed

elasticsearch4s/src/main/scala/jp/co/bizreach/elasticsearch4s/ESClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ class ESClient(queryClient: AbstractClient, httpClient: AsyncHttpClient, url: St
232232
val list = map("hits").asInstanceOf[Map[String, Any]]("hits").asInstanceOf[List[Map[String, Any]]]
233233
list match {
234234
case Nil => stream
235-
case list => scroll0(s"${url}/_search/scroll", scrollId, stream ++ list.map { map =>
235+
case list => scroll0(s"${url}/_search/scroll", scrollId, list.map { map =>
236236
invoker(map("_source").asInstanceOf[Map[String, Any]])
237-
}.toStream, invoker)
237+
}.toStream #::: stream, invoker)
238238
}
239239
}
240240
}

0 commit comments

Comments
 (0)