Skip to content

Commit

Permalink
Refactor AggregationResponse (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjaftn committed Dec 2, 2023
1 parent 24b3070 commit 28d81b7
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 209 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ object HttpExecutorSpec extends IntegrationSpec {
Executor.execute(ElasticRequest.createIndex(firstSearchIndex)),
Executor.execute(ElasticRequest.deleteIndex(firstSearchIndex)).orDie
),
test("aggregate using terms aggregation") {
test("aggregate using terms aggregation with max aggregation as a sub aggregation") {
checkOnce(genDocumentId, genTestDocument, genDocumentId, genTestDocument) {
(firstDocumentId, firstDocument, secondDocumentId, secondDocument) =>
for {
Expand All @@ -481,7 +481,9 @@ object HttpExecutorSpec extends IntegrationSpec {
.refreshTrue
)
aggregation =
termsAggregation(name = "aggregationString", field = TestDocument.stringField.keyword)
termsAggregation(name = "aggregationString", field = TestDocument.stringField.keyword).withSubAgg(
maxAggregation("subAggregation", TestDocument.intField)
)
aggsRes <-
Executor
.execute(ElasticRequest.aggregate(selectors = firstSearchIndex, aggregation = aggregation))
Expand Down

0 comments on commit 28d81b7

Please sign in to comment.