We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I need to get the Aggregation result. is there any possibility to stream agg query using stream publisher?
search(Indexes(s"$indexPrefix*")).size(0).aggregations(termsAgg("distinct_field_agg", field))
The text was updated successfully, but these errors were encountered:
Not sure if I understood correctly, but here is the implementation to stream results using fs2 library I've written:
fs2
object StreamingSearch { def apply[F[_] : Async, A: ClassTag : Decoder](client: ElasticClient, query: SearchRequest): Stream[F, A] = { require(query.sorts.nonEmpty, "Search request must have at least one sort") val emptySearchAfter: Option[Seq[Any]] = None Stream.unfoldChunkEval(emptySearchAfter) { sa => client .execute(query.searchAfter(sa.getOrElse(Seq.empty))) .map { result => val r = result.result if r.nonEmpty then val seq = r.to[A] val searchAfter = r.hits.hits.last.sort Some(Chunk.from(seq), searchAfter) else None } } } }
Sorry, something went wrong.
No branches or pull requests
Hello,
I need to get the Aggregation result. is there any possibility to stream agg query using stream publisher?
search(Indexes(s"$indexPrefix*")).size(0).aggregations(termsAgg("distinct_field_agg", field))
The text was updated successfully, but these errors were encountered: