com.sksamuel.elastic4s.searches.aggs.pipeline.ExtendedStatsBucketBuilder.scala Maven / Gradle / Ivy
package com.sksamuel.elastic4s.searches.aggs.pipeline
import com.sksamuel.elastic4s.EnumConversions
import org.elasticsearch.search.aggregations.pipeline.PipelineAggregatorBuilders
import org.elasticsearch.search.aggregations.pipeline.bucketmetrics.stats.extended.ExtendedStatsBucketPipelineAggregationBuilder
object ExtendedStatsBucketBuilder {
import scala.collection.JavaConverters._
def apply(p: ExtendedStatsBucketDefinition): ExtendedStatsBucketPipelineAggregationBuilder = {
val builder = PipelineAggregatorBuilders.extendedStatsBucket(p.name, p.bucketsPath)
if (p.metadata.nonEmpty) builder.setMetaData(p.metadata.asJava)
p.format.foreach(builder.format)
p.gapPolicy.map(EnumConversions.gapPolicy).foreach(builder.gapPolicy)
builder
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy