Skip to content

Commit 28d81b7

Browse files
authored
Refactor AggregationResponse (#368)
1 parent 24b3070 commit 28d81b7

File tree

2 files changed

+121
-209
lines changed

2 files changed

+121
-209
lines changed

modules/integration/src/test/scala/zio/elasticsearch/HttpExecutorSpec.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ object HttpExecutorSpec extends IntegrationSpec {
467467
Executor.execute(ElasticRequest.createIndex(firstSearchIndex)),
468468
Executor.execute(ElasticRequest.deleteIndex(firstSearchIndex)).orDie
469469
),
470-
test("aggregate using terms aggregation") {
470+
test("aggregate using terms aggregation with max aggregation as a sub aggregation") {
471471
checkOnce(genDocumentId, genTestDocument, genDocumentId, genTestDocument) {
472472
(firstDocumentId, firstDocument, secondDocumentId, secondDocument) =>
473473
for {
@@ -481,7 +481,9 @@ object HttpExecutorSpec extends IntegrationSpec {
481481
.refreshTrue
482482
)
483483
aggregation =
484-
termsAggregation(name = "aggregationString", field = TestDocument.stringField.keyword)
484+
termsAggregation(name = "aggregationString", field = TestDocument.stringField.keyword).withSubAgg(
485+
maxAggregation("subAggregation", TestDocument.intField)
486+
)
485487
aggsRes <-
486488
Executor
487489
.execute(ElasticRequest.aggregate(selectors = firstSearchIndex, aggregation = aggregation))

0 commit comments

Comments
 (0)