Skip to content

Commit 1097401

Browse files
committed
finalize support for window functions with multi-partitioning
1 parent fe9cf7f commit 1097401

File tree

5 files changed

+737
-1
lines changed

5 files changed

+737
-1
lines changed

core/src/main/scala/app/softnetwork/elastic/client/ElasticConversion.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ trait ElasticConversion {
369369
// Handle each aggregation with buckets
370370
bucketAggs.flatMap { case (aggName, buckets, _) =>
371371
buckets.flatMap { bucket =>
372+
val allTopHits = extractAllTopHits(bucket, fieldAliases, aggregations)
373+
372374
val bucketKey = extractBucketKey(bucket)
373375
val docCount = Option(bucket.get("doc_count"))
374376
.map(_.asLong())
@@ -377,7 +379,7 @@ trait ElasticConversion {
377379
val currentContext = parentContext ++ Map(
378380
aggName -> bucketKey,
379381
s"${aggName}_doc_count" -> docCount
380-
)
382+
) ++ allTopHits
381383

382384
// Check for sub-aggregations
383385
val subAggFields = bucket

core/src/main/scala/app/softnetwork/elastic/client/package.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ package object client extends SerializationApi {
162162
* - the source field of the aggregation
163163
* @param windowing
164164
* - whether the aggregation is a window function with partitioning
165+
* @param bucketPath
166+
* - the bucket path for pipeline aggregations
165167
*/
166168
case class ClientAggregation(
167169
aggName: String,

0 commit comments

Comments
 (0)