Skip to content

Commit

Permalink
add new required parameter (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-butcher authored Aug 3, 2023
1 parent 8b32e94 commit 7262c99
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.sksamuel.elastic4s.requests.searches.aggs.{
AbstractAggregation,
AggregationBuilderFn
}
import com.sksamuel.elastic4s.requests.searches.defaultCustomAggregationHandler
import com.sksamuel.elastic4s.requests.searches.queries.Query
import io.circe.{parser, Encoder, Json}
import io.circe.syntax.EncoderOps
Expand All @@ -20,7 +21,11 @@ trait Encoders {

implicit val aggregationEncoder: Encoder[AbstractAggregation] = agg =>
parser
.parse(JacksonBuilder.writeAsString(AggregationBuilderFn(agg).value))
.parse(
JacksonBuilder.writeAsString(
AggregationBuilderFn(agg, defaultCustomAggregationHandler).value
)
)
.getOrElse(Json.obj())

implicit val aggregationsEncoder: Encoder[Seq[AbstractAggregation]] =
Expand Down

0 comments on commit 7262c99

Please sign in to comment.