From 80732a703454fa2da8eeaa24d1127acc1610d7d6 Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 20 Dec 2023 15:16:10 +0800 Subject: [PATCH] Add scale to aggregation content, fix :run --- x-pack/plugin/mapper-exponential-histogram/build.gradle | 4 +--- .../agg/ExponentialHistogramAggregatorFactory.java | 1 - .../agg/InternalExponentialHistogram.java | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/mapper-exponential-histogram/build.gradle b/x-pack/plugin/mapper-exponential-histogram/build.gradle index 2afb0dcba3157..e96e28a06be56 100644 --- a/x-pack/plugin/mapper-exponential-histogram/build.gradle +++ b/x-pack/plugin/mapper-exponential-histogram/build.gradle @@ -11,7 +11,7 @@ esplugin { name 'exponential-histogram' description 'Module for the exponential-histogram field type.' classname 'org.elasticsearch.xpack.exponentialhistogram.ExponentialHistogramMapperPlugin' - extendedPlugins = ['x-pack-core', 'analytics'] + extendedPlugins = ['x-pack-core'] } base { archivesName = 'x-pack-exponential-histogram' @@ -19,6 +19,4 @@ base { dependencies { compileOnly project(path: xpackModule('core')) - compileOnly project(path: xpackModule('analytics')) - //testImplementation project(path: ':x-pack:plugin:analytics') } diff --git a/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/ExponentialHistogramAggregatorFactory.java b/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/ExponentialHistogramAggregatorFactory.java index 6f819aabb1031..fbe943f7ec285 100644 --- a/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/ExponentialHistogramAggregatorFactory.java +++ b/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/ExponentialHistogramAggregatorFactory.java @@ -19,7 +19,6 @@ import org.elasticsearch.search.aggregations.support.ValuesSourceAggregatorFactory; import org.elasticsearch.search.aggregations.support.ValuesSourceConfig; import org.elasticsearch.search.aggregations.support.ValuesSourceRegistry; -import org.elasticsearch.xpack.analytics.aggregations.support.AnalyticsValuesSourceType; import org.elasticsearch.xpack.exponentialhistogram.ExponentialHistogramValuesSourceType; import java.io.IOException; diff --git a/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/InternalExponentialHistogram.java b/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/InternalExponentialHistogram.java index 7c0b75b6823bc..14e5889ab3026 100644 --- a/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/InternalExponentialHistogram.java +++ b/x-pack/plugin/mapper-exponential-histogram/src/main/java/org/elasticsearch/xpack/exponentialhistogram/agg/InternalExponentialHistogram.java @@ -222,6 +222,7 @@ public Object getProperty(List path) { @Override public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException { + builder.field("scale", getCurrentScale()); builder.startArray(CommonFields.BUCKETS.getPreferredName()); for (Bucket bucket : getBuckets()) { builder.startObject()