Skip to content

Commit

Permalink
Fix code remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjaftn committed Nov 15, 2023
1 parent d8a4167 commit c058f2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,10 @@ object HttpExecutorSpec extends IntegrationSpec {
.refreshTrue
)
query = term(field = TestDocument.stringField, value = secondDocumentUpdated.stringField.toLowerCase)

aggregation =
filterAggregation(name = "aggregation", query = query).withSubAgg(
maxAggregation("subAggregation", TestDocument.intField)
)

aggsRes <-
Executor
.execute(ElasticRequest.aggregate(selectors = firstSearchIndex, aggregation = aggregation))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ private[elasticsearch] final case class SumAggregationResponse(value: Double) ex

private[elasticsearch] object SumAggregationResponse {
implicit val decoder: JsonDecoder[SumAggregationResponse] = DeriveJsonDecoder.gen[SumAggregationResponse]

}

private[elasticsearch] final case class TermsAggregationResponse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object ElasticAggregationSpec extends ZIOSpecDefault {
filterAggregation("aggregation", query).withSubAgg(minAggregation("subAggregation", TestDocument.intField))
val aggregationWithMultipleSubAggregations = filterAggregation("aggregation", query)
.withSubAgg(maxAggregation("maxSubAggregation", TestDocument.intField))
.withSubAgg(minAggregation("minSubAggregation", TestDocument.intField))
.withSubAgg(minAggregation("minSubAggregation", TestDocument.doubleField))

assert(aggregation)(
equalTo(
Expand All @@ -162,7 +162,7 @@ object ElasticAggregationSpec extends ZIOSpecDefault {
name = "aggregation",
query = query,
subAggregations = Chunk(
minAggregation("minSubAggregation", TestDocument.intField),
minAggregation("minSubAggregation", TestDocument.doubleField),
maxAggregation("maxSubAggregation", TestDocument.intField)
)
)
Expand Down Expand Up @@ -777,7 +777,7 @@ object ElasticAggregationSpec extends ZIOSpecDefault {
filterAggregation("aggregation", query).withSubAgg(minAggregation("subAggregation", TestDocument.intField))
val aggregationWithMultipleSubAggregations = filterAggregation("aggregation", query)
.withSubAgg(maxAggregation("maxSubAggregation", TestDocument.intField))
.withSubAgg(minAggregation("minSubAggregation", TestDocument.intField))
.withSubAgg(minAggregation("minSubAggregation", TestDocument.doubleField))

val expected =
"""
Expand Down Expand Up @@ -835,7 +835,7 @@ object ElasticAggregationSpec extends ZIOSpecDefault {
| },
| "minSubAggregation": {
| "min": {
| "field": "intField"
| "field": "doubleField"
| }
| }
| }
Expand Down

0 comments on commit c058f2c

Please sign in to comment.