Skip to content

Commit

Permalink
Add some of encoding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbulaja98 committed May 16, 2023
1 parent eb2c26a commit 33f4dc0
Show file tree
Hide file tree
Showing 3 changed files with 373 additions and 236 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ object ElasticRequest {
sealed trait AggregateRequest extends ElasticRequest[AggregationResult]

private[elasticsearch] final case class Aggregate(index: IndexName, aggregation: ElasticAggregation)
extends AggregateRequest
extends AggregateRequest {
def toJson: Json = aggregation.toJson
}

sealed trait BulkRequest
extends ElasticRequest[BulkResponse]
Expand Down Expand Up @@ -645,7 +647,7 @@ object ElasticRequest {
})
}

fromJson merge sizeJson merge highlightsJson merge sortJson merge self.query.toJson merge searchAfterJson merge sourceJson
fromJson merge sizeJson merge highlightsJson merge sortJson merge query.toJson merge searchAfterJson merge sourceJson
}
}

Expand Down Expand Up @@ -730,7 +732,7 @@ object ElasticRequest {
sizeJson merge
highlightsJson merge
sortJson merge
self.query.toJson merge
query.toJson merge
aggregation.toJson merge
searchAfterJson merge
sourceJson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private[elasticsearch] final class HttpExecutor private (esConfig: ElasticConfig
.post(uri"${esConfig.uri}/${r.index}/$Search?typed_keys")
.response(asJson[SearchWithAggregationsResponse])
.contentType(ApplicationJson)
.body(r.aggregation.toJson)
.body(r.toJson)
).flatMap { response =>
response.code match {
case HttpOk =>
Expand Down
Loading

0 comments on commit 33f4dc0

Please sign in to comment.