From f582418ada24f34edd21c4c98b31b7b55df41f6b Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Wed, 30 May 2018 12:55:31 +0200 Subject: [PATCH] Fix missing option serialization after backport Relates #29465 --- .../migrate_7_0/aggregations.asciidoc | 7 ++- .../index/analysis/NoriAnalysisTests.java | 2 +- .../test/search.aggregation/230_composite.yml | 4 +- .../bucket/composite/BinaryValuesSource.java | 4 +- .../bucket/composite/CompositeAggregator.java | 5 -- .../CompositeValuesSourceBuilder.java | 52 ++++-------------- .../CompositeValuesSourceConfig.java | 13 +---- .../CompositeValuesSourceParserHelper.java | 2 - .../DateHistogramValuesSourceBuilder.java | 2 +- .../bucket/composite/DoubleValuesSource.java | 4 +- .../composite/GlobalOrdinalValuesSource.java | 4 +- .../HistogramValuesSourceBuilder.java | 2 +- .../bucket/composite/LongValuesSource.java | 4 +- .../SingleDimensionValuesSource.java | 8 +-- .../composite/TermsValuesSourceBuilder.java | 2 +- .../composite/CompositeAggregatorTests.java | 13 ----- .../CompositeValuesCollectorQueueTests.java | 4 -- .../SingleDimensionValuesSourceTests.java | 53 ------------------- 18 files changed, 33 insertions(+), 152 deletions(-) diff --git a/docs/reference/migration/migrate_7_0/aggregations.asciidoc b/docs/reference/migration/migrate_7_0/aggregations.asciidoc index 5241ba4ccc7..2f947cbe2bf 100644 --- a/docs/reference/migration/migrate_7_0/aggregations.asciidoc +++ b/docs/reference/migration/migrate_7_0/aggregations.asciidoc @@ -9,4 +9,9 @@ These `execution_hint` are removed and should be replaced by `global_ordinals`. The dynamic cluster setting named `search.max_buckets` now defaults to 10,000 (instead of unlimited in the previous version). -Requests that try to return more than the limit will fail with an exception. \ No newline at end of file +Requests that try to return more than the limit will fail with an exception. + +==== `missing` option of the `composite` aggregation has been removed + +The `missing` option of the `composite` aggregation, deprecated in 6.x, +has been removed. `missing_bucket` should be used instead. \ No newline at end of file diff --git a/plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriAnalysisTests.java b/plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriAnalysisTests.java index fa5858a7bbb..d7b89ae6235 100644 --- a/plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriAnalysisTests.java +++ b/plugins/analysis-nori/src/test/java/org/elasticsearch/index/analysis/NoriAnalysisTests.java @@ -98,7 +98,7 @@ public class NoriAnalysisTests extends ESTokenStreamTestCase { .build(); TestAnalysis analysis = createTestAnalysis(settings); Tokenizer tokenizer = analysis.tokenizer.get("my_tokenizer").create(); - tokenizer.setReader(new StringReader("뿌리가 깊은 나무")); + tokenizer.setReader(new StringReader("")); assertTokenStreamContents(tokenizer, new String[] {"뿌리", "가", "깊", "은", "나무"}); tokenizer.setReader(new StringReader("가늠표")); assertTokenStreamContents(tokenizer, new String[] {"가늠표", "가늠", "표"}); diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/230_composite.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/230_composite.yml index cea4e23eb86..7b29ddd2f03 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/230_composite.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/230_composite.yml @@ -327,8 +327,8 @@ setup: --- "Composite aggregation and array size": - skip: - version: " - 6.99.99" - reason: starting in 7.0 the composite sources do not allocate arrays eagerly. + version: " - 6.3.99" + reason: starting in 6.4 the composite sources do not allocate arrays eagerly. - do: search: diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/BinaryValuesSource.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/BinaryValuesSource.java index d1747eb4645..7bfae34b1a3 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/BinaryValuesSource.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/BinaryValuesSource.java @@ -50,8 +50,8 @@ class BinaryValuesSource extends SingleDimensionValuesSource { BinaryValuesSource(BigArrays bigArrays, LongConsumer breakerConsumer, MappedFieldType fieldType, CheckedFunction docValuesFunc, - DocValueFormat format, boolean missingBucket, Object missing, int size, int reverseMul) { - super(bigArrays, format, fieldType, missingBucket, missing, size, reverseMul); + DocValueFormat format, boolean missingBucket, int size, int reverseMul) { + super(bigArrays, format, fieldType, missingBucket, size, reverseMul); this.breakerConsumer = breakerConsumer; this.docValuesFunc = docValuesFunc; this.values = bigArrays.newObjectArray(Math.min(size, 100)); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java index d94f3ab02c3..bfedbea8762 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeAggregator.java @@ -271,7 +271,6 @@ final class CompositeAggregator extends BucketsAggregator { vs::globalOrdinalsValues, config.format(), config.missingBucket(), - config.missing(), size, reverseMul ); @@ -288,7 +287,6 @@ final class CompositeAggregator extends BucketsAggregator { vs::bytesValues, config.format(), config.missingBucket(), - config.missing(), size, reverseMul ); @@ -304,7 +302,6 @@ final class CompositeAggregator extends BucketsAggregator { vs::bytesValues, config.format(), config.missingBucket(), - config.missing(), size, reverseMul ); @@ -318,7 +315,6 @@ final class CompositeAggregator extends BucketsAggregator { vs::doubleValues, config.format(), config.missingBucket(), - config.missing(), size, reverseMul ); @@ -337,7 +333,6 @@ final class CompositeAggregator extends BucketsAggregator { rounding, config.format(), config.missingBucket(), - config.missing(), size, reverseMul ); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java index ab424d60316..cb9c550c05d 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceBuilder.java @@ -23,8 +23,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.ToXContentFragment; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.query.QueryShardException; @@ -42,15 +40,12 @@ import java.util.Objects; * A {@link ValuesSource} builder for {@link CompositeAggregationBuilder} */ public abstract class CompositeValuesSourceBuilder> implements Writeable, ToXContentFragment { - private static final DeprecationLogger DEPRECATION_LOGGER = - new DeprecationLogger(Loggers.getLogger(CompositeValuesSourceBuilder.class)); protected final String name; private String field = null; private Script script = null; private ValueType valueType = null; private boolean missingBucket = false; - private Object missing = null; private SortOrder order = SortOrder.ASC; private String format = null; @@ -72,12 +67,15 @@ public abstract class CompositeValuesSourceBuilder config = ValuesSourceConfig.resolve(context.getQueryShardContext(), - valueType, field, script, missing, null, format); + valueType, field, script, null,null, format); - if (config.unmapped() && field != null && missing == null && missingBucket == false) { + if (config.unmapped() && field != null && missingBucket == false) { // this source cannot produce any values so we refuse to build // since composite buckets are not created on null values by default. throw new QueryShardException(context.getQueryShardContext(), "failed to find field [" + field + "] and [missing_bucket] is not set"); } - if (missingBucket && missing != null) { - throw new QueryShardException(context.getQueryShardContext(), - "cannot use [missing] option in conjunction with [missing_bucket]"); - } return innerBuild(context, config); } } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java index c0d30982477..bf88285c190 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java @@ -32,7 +32,6 @@ class CompositeValuesSourceConfig { private final ValuesSource vs; private final DocValueFormat format; private final int reverseMul; - private final Object missing; private final boolean missingBucket; /** @@ -42,18 +41,15 @@ class CompositeValuesSourceConfig { * @param vs The underlying {@link ValuesSource}. * @param format The {@link DocValueFormat} of this source. * @param order The sort order associated with this source. - * @param missing The missing value or null if documents with missing value should be ignored. */ CompositeValuesSourceConfig(String name, @Nullable MappedFieldType fieldType, ValuesSource vs, DocValueFormat format, - SortOrder order, boolean missingBucket, @Nullable Object missing) { + SortOrder order, boolean missingBucket) { this.name = name; this.fieldType = fieldType; this.vs = vs; this.format = format; this.reverseMul = order == SortOrder.ASC ? 1 : -1; this.missingBucket = missingBucket; - assert missingBucket == false || missing == null; - this.missing = missing; } /** @@ -85,13 +81,6 @@ class CompositeValuesSourceConfig { return format; } - /** - * The missing value for this configuration or null if documents with missing value should be ignored. - */ - Object missing() { - return missing; - } - /** * If true, an explicit `null bucket represents documents with missing values. */ diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java index 8dae1fecc24..713ecfc6628 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceParserHelper.java @@ -38,8 +38,6 @@ class CompositeValuesSourceParserHelper { ValueType targetValueType) { objectParser.declareField(VB::field, XContentParser::text, new ParseField("field"), ObjectParser.ValueType.STRING); - objectParser.declareField(VB::missing, XContentParser::objectText, - new ParseField("missing"), ObjectParser.ValueType.VALUE); objectParser.declareBoolean(VB::missingBucket, new ParseField("missing_bucket")); objectParser.declareField(VB::valueType, p -> { diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java index b620c2bf0fc..28970ec828a 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DateHistogramValuesSourceBuilder.java @@ -226,7 +226,7 @@ public class DateHistogramValuesSourceBuilder extends CompositeValuesSourceBuild // is specified in the builder. final DocValueFormat docValueFormat = format() == null ? DocValueFormat.RAW : config.format(); final MappedFieldType fieldType = config.fieldContext() != null ? config.fieldContext().fieldType() : null; - return new CompositeValuesSourceConfig(name, fieldType, vs, docValueFormat, order(), missingBucket(), missing()); + return new CompositeValuesSourceConfig(name, fieldType, vs, docValueFormat, order(), missingBucket()); } else { throw new IllegalArgumentException("invalid source, expected numeric, got " + orig.getClass().getSimpleName()); } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DoubleValuesSource.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DoubleValuesSource.java index 2288d691463..d243b0e7592 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DoubleValuesSource.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/DoubleValuesSource.java @@ -45,8 +45,8 @@ class DoubleValuesSource extends SingleDimensionValuesSource { DoubleValuesSource(BigArrays bigArrays, MappedFieldType fieldType, CheckedFunction docValuesFunc, - DocValueFormat format, boolean missingBucket, Object missing, int size, int reverseMul) { - super(bigArrays, format, fieldType, missingBucket, missing, size, reverseMul); + DocValueFormat format, boolean missingBucket, int size, int reverseMul) { + super(bigArrays, format, fieldType, missingBucket, size, reverseMul); this.docValuesFunc = docValuesFunc; this.bits = missingBucket ? new BitArray(bigArrays, 100) : null; this.values = bigArrays.newDoubleArray(Math.min(size, 100), false); diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java index e24558d7619..4275d1eb838 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/GlobalOrdinalValuesSource.java @@ -54,8 +54,8 @@ class GlobalOrdinalValuesSource extends SingleDimensionValuesSource { GlobalOrdinalValuesSource(BigArrays bigArrays, MappedFieldType type, CheckedFunction docValuesFunc, - DocValueFormat format, boolean missingBucket, Object missing, int size, int reverseMul) { - super(bigArrays, format, type, missingBucket, missing, size, reverseMul); + DocValueFormat format, boolean missingBucket, int size, int reverseMul) { + super(bigArrays, format, type, missingBucket, size, reverseMul); this.docValuesFunc = docValuesFunc; this.values = bigArrays.newLongArray(Math.min(size, 100), false); } diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java index 76e2bc823ff..75e2b8a3aae 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/HistogramValuesSourceBuilder.java @@ -115,7 +115,7 @@ public class HistogramValuesSourceBuilder extends CompositeValuesSourceBuilder { LongValuesSource(BigArrays bigArrays, MappedFieldType fieldType, CheckedFunction docValuesFunc, - LongUnaryOperator rounding, DocValueFormat format, boolean missingBucket, Object missing, int size, int reverseMul) { - super(bigArrays, format, fieldType, missingBucket, missing, size, reverseMul); + LongUnaryOperator rounding, DocValueFormat format, boolean missingBucket, int size, int reverseMul) { + super(bigArrays, format, fieldType, missingBucket, size, reverseMul); this.bigArrays = bigArrays; this.docValuesFunc = docValuesFunc; this.rounding = rounding; diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java index 0781ed5d94d..1718bb42048 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSource.java @@ -41,8 +41,6 @@ abstract class SingleDimensionValuesSource> implements R protected final DocValueFormat format; @Nullable protected final MappedFieldType fieldType; - @Nullable - protected final Object missing; protected final boolean missingBucket; protected final int size; @@ -57,18 +55,15 @@ abstract class SingleDimensionValuesSource> implements R * @param format The format of the source. * @param fieldType The field type or null if the source is a script. * @param missingBucket If true, an explicit `null bucket represents documents with missing values. - * @param missing The missing value or null if documents with missing value should be ignored. * @param size The number of values to record. * @param reverseMul -1 if the natural order ({@link SortOrder#ASC} should be reversed. */ SingleDimensionValuesSource(BigArrays bigArrays, DocValueFormat format, - @Nullable MappedFieldType fieldType, boolean missingBucket, @Nullable Object missing, + @Nullable MappedFieldType fieldType, boolean missingBucket, int size, int reverseMul) { - assert missing == null || missingBucket == false; this.bigArrays = bigArrays; this.format = format; this.fieldType = fieldType; - this.missing = missing; this.missingBucket = missingBucket; this.size = size; this.reverseMul = reverseMul; @@ -147,7 +142,6 @@ abstract class SingleDimensionValuesSource> implements R */ protected boolean checkIfSortedDocsIsApplicable(IndexReader reader, MappedFieldType fieldType) { if (fieldType == null || - missing != null || (missingBucket && afterValue == null) || fieldType.indexOptions() == IndexOptions.NONE || // inverse of the natural order diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java index 04d99d9652a..75bdd02855e 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/TermsValuesSourceBuilder.java @@ -93,6 +93,6 @@ public class TermsValuesSourceBuilder extends CompositeValuesSourceBuilder createAggregator(builder, searcher)); - assertWarnings("[missing] is deprecated. Please use [missing_bucket] instead."); - assertThat(exc.getMessage(), containsString("cannot use [missing] option in conjunction with [missing_bucket]")); - } - public void testWithKeyword() throws Exception { final List>> dataset = new ArrayList<>(); dataset.addAll( diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueueTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueueTests.java index 02a6a8b9ed6..006b13e2c0b 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueueTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesCollectorQueueTests.java @@ -224,7 +224,6 @@ public class CompositeValuesCollectorQueueTests extends AggregatorTestCase { value -> value, DocValueFormat.RAW, missingBucket, - null, size, 1 ); @@ -235,7 +234,6 @@ public class CompositeValuesCollectorQueueTests extends AggregatorTestCase { context -> FieldData.sortableLongBitsToDoubles(DocValues.getSortedNumeric(context.reader(), fieldType.name())), DocValueFormat.RAW, missingBucket, - null, size, 1 ); @@ -249,7 +247,6 @@ public class CompositeValuesCollectorQueueTests extends AggregatorTestCase { context -> DocValues.getSortedSet(context.reader(), fieldType.name()), DocValueFormat.RAW, missingBucket, - null, size, 1 ); @@ -261,7 +258,6 @@ public class CompositeValuesCollectorQueueTests extends AggregatorTestCase { context -> FieldData.toString(DocValues.getSortedSet(context.reader(), fieldType.name())), DocValueFormat.RAW, missingBucket, - null, size, 1 ); diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSourceTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSourceTests.java index b436b43b462..69189d4e713 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSourceTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/composite/SingleDimensionValuesSourceTests.java @@ -46,7 +46,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 1, 1 ); @@ -57,20 +56,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { assertNull(source.createSortedDocsProducerOrNull(reader, new TermQuery(new Term("keyword", "toto)")))); - source = new BinaryValuesSource( - BigArrays.NON_RECYCLING_INSTANCE, - (b) -> {}, - keyword, - context -> null, - DocValueFormat.RAW, - false, - "missing_value", - 1, - 1 - ); - assertNull(source.createSortedDocsProducerOrNull(reader, new MatchAllDocsQuery())); - assertNull(source.createSortedDocsProducerOrNull(reader, null)); - source = new BinaryValuesSource( BigArrays.NON_RECYCLING_INSTANCE, (b) -> {}, @@ -78,7 +63,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, true, - null, 1, 1 ); @@ -92,7 +76,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 0, -1 ); @@ -107,7 +90,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 1, 1); assertNull(source.createSortedDocsProducerOrNull(reader, null)); @@ -121,7 +103,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { keyword, context -> null, DocValueFormat.RAW, false, - null, 1, 1 ); @@ -132,26 +113,12 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { assertNull(source.createSortedDocsProducerOrNull(reader, new TermQuery(new Term("keyword", "toto)")))); - source = new GlobalOrdinalValuesSource( - BigArrays.NON_RECYCLING_INSTANCE, - keyword, - context -> null, - DocValueFormat.RAW, - false, - "missing_value", - 1, - 1 - ); - assertNull(source.createSortedDocsProducerOrNull(reader, new MatchAllDocsQuery())); - assertNull(source.createSortedDocsProducerOrNull(reader, null)); - source = new GlobalOrdinalValuesSource( BigArrays.NON_RECYCLING_INSTANCE, keyword, context -> null, DocValueFormat.RAW, true, - null, 1, 1 ); @@ -164,7 +131,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 1, -1 ); @@ -178,7 +144,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 1, 1 ); @@ -202,7 +167,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { value -> value, DocValueFormat.RAW, false, - null, 1, 1 ); @@ -214,27 +178,12 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { assertNull(source.createSortedDocsProducerOrNull(reader, new TermQuery(new Term("keyword", "toto)")))); LongValuesSource sourceWithMissing = new LongValuesSource( - BigArrays.NON_RECYCLING_INSTANCE, - number, - context -> null, - value -> value, - DocValueFormat.RAW, - false, - 0d, - 1, - 1); - assertNull(sourceWithMissing.createSortedDocsProducerOrNull(reader, new MatchAllDocsQuery())); - assertNull(sourceWithMissing.createSortedDocsProducerOrNull(reader, null)); - assertNull(sourceWithMissing.createSortedDocsProducerOrNull(reader, new TermQuery(new Term("keyword", "toto)")))); - - sourceWithMissing = new LongValuesSource( BigArrays.NON_RECYCLING_INSTANCE, number, context -> null, value -> value, DocValueFormat.RAW, true, - null, 1, 1); assertNull(sourceWithMissing.createSortedDocsProducerOrNull(reader, new MatchAllDocsQuery())); @@ -248,7 +197,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { value -> value, DocValueFormat.RAW, false, - null, 1, -1 ); @@ -262,7 +210,6 @@ public class SingleDimensionValuesSourceTests extends ESTestCase { context -> null, DocValueFormat.RAW, false, - null, 1, 1 );