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 17, 2023
1 parent 8583e50 commit 5914223
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 @@ -190,12 +190,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 @@ -307,7 +307,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 @@ -158,7 +158,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 @@ -184,7 +184,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 @@ -872,7 +872,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 @@ -930,7 +930,7 @@ object ElasticAggregationSpec extends ZIOSpecDefault {
| },
| "minSubAggregation": {
| "min": {
| "field": "intField"
| "field": "doubleField"
| }
| }
| }
Expand Down

0 comments on commit 5914223

Please sign in to comment.