diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java index 016a1cfd0eac4..bf81003f5e1f4 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/MatchOnlyTextFieldMapper.java @@ -55,7 +55,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.TextDocValuesField; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.lookup.SourceProvider; @@ -434,7 +433,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapper.java index fb4263c1617a5..c45065037b5a8 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/RankFeatureMetaFieldMapper.java @@ -16,7 +16,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collections; @@ -78,7 +77,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java index 4bd2521b70eb8..14c180dc0b65c 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/ScaledFloatFieldMapper.java @@ -43,7 +43,6 @@ import org.elasticsearch.index.mapper.TimeSeriesParams; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.DocValuesScriptFieldFactory; import org.elasticsearch.script.field.ScaledFloatDocValuesField; import org.elasticsearch.script.field.ToScriptFieldFactory; @@ -700,7 +699,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasDocValues == false) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it doesn't have doc values" diff --git a/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java b/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java index 1bb56370dc09a..db817917ff29e 100644 --- a/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java +++ b/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java @@ -35,7 +35,6 @@ import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.mapper.TextParams; import org.elasticsearch.index.mapper.TextSearchInfo; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.xcontent.XContentBuilder; @@ -578,7 +577,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java b/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java index 47327e1dbdb88..dd6e7035a1c17 100644 --- a/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java +++ b/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java @@ -19,7 +19,6 @@ import org.elasticsearch.index.mapper.SourceLoader; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collections; @@ -100,7 +99,7 @@ public FieldMapper.Builder getMergeBuilder() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java index 4a476bb861978..09633a0ea1b3f 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java @@ -44,7 +44,6 @@ import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; @@ -846,7 +845,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return new StringStoredFieldFieldLoader(name(), simpleName(), null) { @Override protected void write(XContentBuilder b, Object value) throws IOException { diff --git a/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java index fe03ec1992146..5552f62bf8ce4 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java @@ -21,7 +21,6 @@ import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.BytesBinaryIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.xcontent.XContentBuilder; @@ -207,7 +206,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java index 19dd074bda9a1..c6b428458d2b9 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java @@ -33,7 +33,6 @@ import org.elasticsearch.index.fielddata.SourceValueFetcherSortedBooleanIndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.BooleanFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptCompiler; @@ -493,7 +492,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript()) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java index 0661d1d449d87..ece0b082a3ccf 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DataStreamTimestampFieldMapper.java @@ -16,7 +16,6 @@ import org.elasticsearch.index.TimestampBounds; import org.elasticsearch.index.mapper.DateFieldMapper.Resolution; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; @@ -271,7 +270,7 @@ public boolean isEnabled() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java index 078070b124b59..63045623c503b 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java @@ -43,7 +43,6 @@ import org.elasticsearch.index.query.DateRangeIncludingNowQuery; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.DateFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptCompiler; @@ -968,7 +967,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java index 916da039d3beb..a7283cf0a28ec 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/DocCountFieldMapper.java @@ -15,7 +15,6 @@ import org.elasticsearch.common.xcontent.XContentParserUtils; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; @@ -129,7 +128,7 @@ public static IndexableField field(int count) { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return new SyntheticFieldLoader(); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java index 7f84f1f6a11f9..8aa29e6317d51 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldAliasMapper.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexVersion; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; @@ -158,7 +157,7 @@ public FieldAliasMapper build(MapperBuilderContext context) { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index 52f58199f215f..040963b0f8bad 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -24,7 +24,6 @@ import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexVersions; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptType; import org.elasticsearch.search.lookup.SearchLookup; @@ -470,12 +469,12 @@ protected SyntheticSourceMode syntheticSourceMode() { /** * Mappers override this method with native synthetic source support. * If mapper does not support synthetic source, it is generated using generic implementation - * in {@link DocumentParser#parseObjectOrField} and {@link Mapper#syntheticFieldLoader(NestedScope)}. + * in {@link DocumentParser#parseObjectOrField} and {@link ObjectMapper#syntheticFieldLoader()}. * * @return implementation of {@link SourceLoader.SyntheticFieldLoader} */ @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { // If mapper supports synthetic source natively, it overrides this method, // /so we won't see those here. if (syntheticSourceMode() == SyntheticSourceMode.FALLBACK) { @@ -488,7 +487,7 @@ public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nested return SourceLoader.SyntheticFieldLoader.NOTHING; } - return super.syntheticFieldLoader(nestedScope); + return super.syntheticFieldLoader(); } public static final class MultiFields implements Iterable, ToXContent { diff --git a/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java index 8a6bcd16ab11a..57a4885d44d5a 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java @@ -17,7 +17,6 @@ import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexVersions; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collections; @@ -190,7 +189,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java index 15ce990e2cbd1..296e7df98b0cf 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java @@ -34,7 +34,6 @@ import org.elasticsearch.index.fielddata.SourceValueFetcherMultiGeoPointIndexFieldData; import org.elasticsearch.index.fielddata.plain.LatLonPointIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.GeoPointFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptCompiler; @@ -577,7 +576,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript()) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java index a98db2666a711..c5b1f575d941f 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java @@ -17,7 +17,6 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Arrays; import java.util.Collection; @@ -52,7 +51,7 @@ protected final String contentType() { } @Override - public final SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public final SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IgnoredFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IgnoredFieldMapper.java index b371ff0a467b2..b0f153252ac4e 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IgnoredFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IgnoredFieldMapper.java @@ -22,7 +22,6 @@ import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.KeywordDocValuesField; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; @@ -143,7 +142,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java index 7a0ab8330db9d..1b2667fe9d2ea 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java @@ -19,7 +19,6 @@ import org.elasticsearch.index.fielddata.plain.ConstantIndexFieldData; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.DelegateDocValuesField; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.fetch.StoredFieldsSpec; @@ -114,7 +113,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java index eb59821ca3bed..1d73e256bd2e9 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java @@ -34,7 +34,6 @@ import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.IpFieldScript; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptCompiler; @@ -608,7 +607,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript()) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java index dc11930a7dfdc..438964cf0a092 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java @@ -48,7 +48,6 @@ import org.elasticsearch.index.fielddata.StoredFieldSortedBinaryIndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptCompiler; @@ -1028,7 +1027,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return syntheticFieldLoader(simpleName()); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/LegacyTypeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/LegacyTypeFieldMapper.java index ec6cc17bf50f9..359faf2d6f4b0 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/LegacyTypeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/LegacyTypeFieldMapper.java @@ -14,7 +14,6 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collection; import java.util.Collections; @@ -108,7 +107,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java index 64b428b54fca0..7c047125a80d3 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/Mapper.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.util.StringLiteralDeduplicator; import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexVersions; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.ToXContentFragment; import java.util.Map; @@ -98,7 +97,7 @@ public final String simpleName() { * users configure synthetic source in the mapping without configuring all * fields properly. */ - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { throw new IllegalArgumentException("field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source"); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java b/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java index 6d6297cc49bb2..acfe0fcfbf5bd 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/Mapping.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.mapper.MapperService.MergeReason; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.ToXContentFragment; import org.elasticsearch.xcontent.XContentBuilder; @@ -128,7 +127,7 @@ private boolean isSourceSynthetic() { public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { var stream = Stream.concat(Stream.of(metadataMappers), root.mappers.values().stream()); - return root.syntheticFieldLoader(new NestedScope(), stream); + return root.syntheticFieldLoader(stream); } /** diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java index 11b54a4fa9710..93ffbbf552071 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.util.Maps; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexVersions; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; @@ -222,5 +221,5 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public abstract SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope); + public abstract SourceLoader.SyntheticFieldLoader syntheticFieldLoader(); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/NestedPathFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/NestedPathFieldMapper.java index 689a3f1df325d..6a0f4a87eb890 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/NestedPathFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/NestedPathFieldMapper.java @@ -17,7 +17,6 @@ import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.IndexVersions; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collections; @@ -86,7 +85,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java index be18533ddd3d7..fce0fb7a83ae4 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java @@ -44,7 +44,6 @@ import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; import org.elasticsearch.index.mapper.TimeSeriesParams.MetricType; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.DoubleFieldScript; import org.elasticsearch.script.LongFieldScript; import org.elasticsearch.script.Script; @@ -1986,7 +1985,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript()) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java index e8e7c97602971..2e826c1294d60 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RangeFieldMapper.java @@ -25,7 +25,6 @@ import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.BinaryIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.xcontent.XContentBuilder; @@ -469,7 +468,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasDocValues == false) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it doesn't have doc values" diff --git a/server/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java index 2093bb001bed4..39686c3f30555 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import java.util.Collections; import java.util.Map; @@ -122,7 +121,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/SeqNoFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/SeqNoFieldMapper.java index 79250d1414d42..a46a310d0770f 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/SeqNoFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/SeqNoFieldMapper.java @@ -23,7 +23,6 @@ import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.script.field.SeqNoDocValuesField; @@ -247,7 +246,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java index 90bcf57658620..b819ffb0ef6ad 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java @@ -25,7 +25,6 @@ import org.elasticsearch.index.IndexVersions; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.lookup.Source; import org.elasticsearch.search.lookup.SourceFilter; import org.elasticsearch.xcontent.XContentType; @@ -364,7 +363,7 @@ public FieldMapper.Builder getMergeBuilder() { */ public SourceLoader newSourceLoader(Mapping mapping, SourceFieldMetrics metrics) { if (mode == Mode.SYNTHETIC) { - return new SourceLoader.Synthetic(mapping::syntheticFieldLoader, metrics); + return new SourceLoader.Synthetic(mapping, metrics); } return SourceLoader.FROM_STORED_SOURCE; } @@ -374,7 +373,7 @@ public boolean isSynthetic() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java index 8dc530932a608..04d158c5ee99c 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java @@ -66,7 +66,6 @@ import org.elasticsearch.index.fielddata.StoredFieldSortedBinaryIndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.script.field.DelegateDocValuesField; import org.elasticsearch.script.field.TextDocValuesField; @@ -1453,7 +1452,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesIdFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesIdFieldMapper.java index 89863e5555306..112b3ec96b39e 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesIdFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesIdFieldMapper.java @@ -33,7 +33,6 @@ import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.fielddata.plain.SortedOrdinalsIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.DelegateDocValuesField; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; @@ -160,7 +159,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java index 65f1b642aab8e..b9629d7561982 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java @@ -21,7 +21,6 @@ import org.elasticsearch.index.fielddata.ScriptDocValues; import org.elasticsearch.index.fielddata.plain.SortedOrdinalsIndexFieldData; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.DelegateDocValuesField; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; @@ -130,7 +129,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java index ce22fb6fe3e77..1d4f56b02ed74 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java @@ -17,7 +17,6 @@ import org.elasticsearch.index.fielddata.plain.SortedNumericIndexFieldData; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.field.VersionDocValuesField; import java.util.Collections; @@ -104,7 +103,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return SourceLoader.SyntheticFieldLoader.NOTHING; } } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java index 62ac7a1744159..024cc5cb721e6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldMapper.java @@ -60,7 +60,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.script.field.FlattenedDocValuesField; @@ -811,7 +810,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasScript()) { return SourceLoader.SyntheticFieldLoader.NOTHING; } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java index 77df0bb333034..b47f6fd80a77e 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java @@ -64,7 +64,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.search.vectors.ESDiversifyingChildrenByteKnnVectorQuery; @@ -1591,7 +1590,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java b/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java index 2ba56aef6a074..d417d6c647d05 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java @@ -22,7 +22,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.IndexVersion; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.CompositeFieldScript; @@ -3245,7 +3244,7 @@ protected String contentType() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { return new StringStoredFieldFieldLoader(name(), simpleName(), null) { @Override protected void write(XContentBuilder b, Object value) throws IOException { diff --git a/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java b/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java index 920c533a2b850..505b89bf28601 100644 --- a/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java +++ b/server/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java @@ -18,7 +18,6 @@ import org.elasticsearch.index.IndexVersion; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xcontent.XContentType; @@ -510,8 +509,8 @@ public void testSubobjectsCannotBeUpdatedOnRoot() throws IOException { public void testSyntheticSourceDocValuesEmpty() throws IOException { DocumentMapper mapper = createDocumentMapper(mapping(b -> b.startObject("o").field("type", "object").endObject())); ObjectMapper o = (ObjectMapper) mapper.mapping().getRoot().getMapper("o"); - assertThat(o.syntheticFieldLoader(new NestedScope()).docValuesLoader(null, null), nullValue()); - assertThat(mapper.mapping().getRoot().syntheticFieldLoader(new NestedScope()).docValuesLoader(null, null), nullValue()); + assertThat(o.syntheticFieldLoader().docValuesLoader(null, null), nullValue()); + assertThat(mapper.mapping().getRoot().syntheticFieldLoader().docValuesLoader(null, null), nullValue()); } /** @@ -536,8 +535,8 @@ public void testSyntheticSourceDocValuesFieldWithout() throws IOException { b.endObject().endObject(); })); ObjectMapper o = (ObjectMapper) mapper.mapping().getRoot().getMapper("o"); - assertThat(o.syntheticFieldLoader(new NestedScope()).docValuesLoader(null, null), nullValue()); - assertThat(mapper.mapping().getRoot().syntheticFieldLoader(new NestedScope()).docValuesLoader(null, null), nullValue()); + assertThat(o.syntheticFieldLoader().docValuesLoader(null, null), nullValue()); + assertThat(mapper.mapping().getRoot().syntheticFieldLoader().docValuesLoader(null, null), nullValue()); } public void testStoreArraySourceinSyntheticSourceMode() throws IOException { diff --git a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java index a47fa6ee112ed..b2c2afd9df429 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java @@ -41,7 +41,6 @@ import org.elasticsearch.index.fieldvisitor.LeafStoredFieldLoader; import org.elasticsearch.index.fieldvisitor.StoredFieldLoader; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.termvectors.TermVectorsService; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.script.Script; @@ -1467,10 +1466,7 @@ private void assertNoDocValueLoader(CheckedConsumer { - throw new UnsupportedOperationException(); - }); + NestedObjectMapper.Builder chunksField = new NestedObjectMapper.Builder(CHUNKS_FIELD, indexVersionCreated); chunksField.dynamic(ObjectMapper.Dynamic.FALSE); KeywordFieldMapper.Builder chunkTextField = new KeywordFieldMapper.Builder(CHUNKED_TEXT_FIELD, indexVersionCreated).indexed(false) .docValues(false); diff --git a/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java b/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java index 5674a28dc4855..81abe3dc5c088 100644 --- a/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java +++ b/x-pack/plugin/mapper-aggregate-metric/src/main/java/org/elasticsearch/xpack/aggregatemetric/mapper/AggregateDoubleMetricFieldMapper.java @@ -46,7 +46,6 @@ import org.elasticsearch.index.mapper.XContentDataHelper; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.script.ScriptCompiler; import org.elasticsearch.script.field.DelegateDocValuesField; import org.elasticsearch.script.field.DocValuesScriptFieldFactory; @@ -724,7 +723,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { // Note that malformed values are handled via `IgnoredSourceFieldMapper` infrastructure return new AggregateMetricSyntheticFieldLoader(name(), simpleName(), metrics); } diff --git a/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java b/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java index d4057474c0c5d..c27b3c8207102 100644 --- a/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java +++ b/x-pack/plugin/mapper-constant-keyword/src/main/java/org/elasticsearch/xpack/constantkeyword/mapper/ConstantKeywordFieldMapper.java @@ -45,7 +45,6 @@ import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.QueryRewriteContext; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; @@ -350,7 +349,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { String value = fieldType().value(); ; if (value == null) { diff --git a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java index 40198eeb57aa1..05c807cffdd35 100644 --- a/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java +++ b/x-pack/plugin/mapper-unsigned-long/src/main/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongFieldMapper.java @@ -42,7 +42,6 @@ import org.elasticsearch.index.mapper.TimeSeriesParams.MetricType; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.TimeSeriesValuesSourceType; import org.elasticsearch.search.aggregations.support.ValuesSourceType; @@ -752,7 +751,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (hasDocValues == false) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it doesn't have doc values" diff --git a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java index 71ccf7cad7d62..bab91e5d99eca 100644 --- a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java +++ b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java @@ -54,7 +54,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.xcontent.XContentParser; @@ -452,7 +451,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to" diff --git a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java index cb6a5d9ef0bd2..6f2c15836a04a 100644 --- a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java +++ b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java @@ -72,7 +72,6 @@ import org.elasticsearch.index.mapper.TextSearchInfo; import org.elasticsearch.index.mapper.ValueFetcher; import org.elasticsearch.index.query.SearchExecutionContext; -import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.aggregations.support.CoreValuesSourceType; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; @@ -992,7 +991,7 @@ protected SyntheticSourceMode syntheticSourceMode() { } @Override - public SourceLoader.SyntheticFieldLoader syntheticFieldLoader(NestedScope nestedScope) { + public SourceLoader.SyntheticFieldLoader syntheticFieldLoader() { if (copyTo.copyToFields().isEmpty() != true) { throw new IllegalArgumentException( "field [" + name() + "] of type [" + typeName() + "] doesn't support synthetic source because it declares copy_to"