|
@@ -15,6 +15,8 @@ import org.apache.lucene.search.Query;
|
|
|
import org.apache.lucene.search.SortField;
|
|
|
import org.apache.lucene.search.SortedNumericSortField;
|
|
|
import org.apache.lucene.util.NumericUtils;
|
|
|
+import org.elasticsearch.common.logging.DeprecationCategory;
|
|
|
+import org.elasticsearch.common.logging.DeprecationLogger;
|
|
|
import org.elasticsearch.common.time.DateMathParser;
|
|
|
import org.elasticsearch.common.util.BigArrays;
|
|
|
import org.elasticsearch.index.IndexMode;
|
|
@@ -74,6 +76,8 @@ import static org.elasticsearch.common.xcontent.XContentParserUtils.ensureExpect
|
|
|
/** A {@link FieldMapper} for a field containing aggregate metrics such as min/max/value_count etc. */
|
|
|
public class AggregateDoubleMetricFieldMapper extends FieldMapper {
|
|
|
|
|
|
+ private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(AggregateDoubleMetricFieldMapper.class);
|
|
|
+
|
|
|
public static final String CONTENT_TYPE = "aggregate_metric_double";
|
|
|
public static final String SUBFIELD_SEPARATOR = ".";
|
|
|
|
|
@@ -187,6 +191,13 @@ public class AggregateDoubleMetricFieldMapper extends FieldMapper {
|
|
|
|
|
|
@Override
|
|
|
public AggregateDoubleMetricFieldMapper build(MapperBuilderContext context) {
|
|
|
+ if (multiFieldsBuilder.hasMultiFields()) {
|
|
|
+ DEPRECATION_LOGGER.warn(
|
|
|
+ DeprecationCategory.MAPPINGS,
|
|
|
+ CONTENT_TYPE + "_multifields",
|
|
|
+ "Adding multifields to [" + CONTENT_TYPE + "] mappers has no effect and will be forbidden in future"
|
|
|
+ );
|
|
|
+ }
|
|
|
if (defaultMetric.isConfigured() == false) {
|
|
|
// If a single metric is contained, this should be the default
|
|
|
if (metrics.getValue().size() == 1) {
|