From 49e965fab08b674a05faf004eca97869a1944f62 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Thu, 21 May 2015 16:07:07 -0700 Subject: [PATCH] Mappings: Remove generics from FieldMapper FieldMapper is currently generic, where the templated type is only used as the return of a single function, value(Object). This change simply removes this generic type. It is not needed. The implementations of value() now has a covariant return (so those methods have not changed). --- .../queries/ExtendedCommonTermsQuery.java | 4 ++-- .../analyze/TransportAnalyzeAction.java | 2 +- .../TransportGetFieldMappingsIndexAction.java | 20 +++++++++---------- .../index/fielddata/IndexFieldData.java | 2 +- .../fielddata/IndexFieldDataService.java | 2 +- .../plain/BytesBinaryDVIndexFieldData.java | 2 +- .../plain/DisabledIndexFieldData.java | 2 +- .../plain/DocValuesIndexFieldData.java | 2 +- .../plain/DoubleArrayIndexFieldData.java | 2 +- .../plain/FSTBytesIndexFieldData.java | 2 +- .../plain/FloatArrayIndexFieldData.java | 2 +- .../plain/GeoPointBinaryDVIndexFieldData.java | 2 +- .../GeoPointCompressedIndexFieldData.java | 2 +- .../GeoPointDoubleArrayIndexFieldData.java | 2 +- .../fielddata/plain/IndexIndexFieldData.java | 2 +- .../plain/PackedArrayIndexFieldData.java | 2 +- .../plain/PagedBytesIndexFieldData.java | 2 +- .../plain/ParentChildIndexFieldData.java | 2 +- .../index/fieldvisitor/FieldsVisitor.java | 2 +- .../index/get/ShardGetService.java | 4 ++-- .../index/mapper/DocumentFieldMappers.java | 20 +++++++++---------- .../index/mapper/DocumentMapper.java | 10 +++++----- .../index/mapper/DocumentParser.java | 2 +- .../index/mapper/FieldMapper.java | 5 ++--- .../index/mapper/FieldMappersLookup.java | 16 +++++++-------- .../index/mapper/MapperService.java | 20 +++++++++---------- .../index/mapper/MapperUtils.java | 10 +++++----- .../index/mapper/MergeResult.java | 4 ++-- .../mapper/core/AbstractFieldMapper.java | 4 ++-- .../index/mapper/core/BinaryFieldMapper.java | 2 +- .../index/mapper/core/BooleanFieldMapper.java | 2 +- .../index/mapper/core/ByteFieldMapper.java | 2 +- .../mapper/core/CompletionFieldMapper.java | 2 +- .../index/mapper/core/DateFieldMapper.java | 2 +- .../index/mapper/core/DoubleFieldMapper.java | 2 +- .../index/mapper/core/FloatFieldMapper.java | 2 +- .../index/mapper/core/IntegerFieldMapper.java | 2 +- .../index/mapper/core/LongFieldMapper.java | 2 +- .../index/mapper/core/NumberFieldMapper.java | 2 +- .../index/mapper/core/ShortFieldMapper.java | 2 +- .../index/mapper/core/StringFieldMapper.java | 2 +- .../index/mapper/geo/GeoPointFieldMapper.java | 2 +- .../index/mapper/geo/GeoShapeFieldMapper.java | 2 +- .../index/mapper/internal/AllFieldMapper.java | 2 +- .../internal/FieldNamesFieldMapper.java | 2 +- .../index/mapper/internal/IdFieldMapper.java | 2 +- .../mapper/internal/IndexFieldMapper.java | 2 +- .../mapper/internal/ParentFieldMapper.java | 2 +- .../mapper/internal/RoutingFieldMapper.java | 2 +- .../mapper/internal/SourceFieldMapper.java | 2 +- .../mapper/internal/TypeFieldMapper.java | 2 +- .../index/mapper/internal/UidFieldMapper.java | 2 +- .../mapper/internal/VersionFieldMapper.java | 2 +- .../index/mapper/ip/IpFieldMapper.java | 2 +- .../index/mapper/object/ObjectMapper.java | 2 +- .../percolator/QueriesLoaderCollector.java | 2 +- .../index/query/CommonTermsQueryParser.java | 2 +- .../index/query/QueryParseContext.java | 2 +- .../index/query/TermsQueryParser.java | 2 +- .../functionscore/DecayFunctionParser.java | 6 +++--- .../random/RandomScoreFunctionParser.java | 2 +- .../index/search/MatchQuery.java | 2 +- .../percolator/PercolatorService.java | 2 +- .../percolator/QueryCollector.java | 2 +- .../ExpressionScriptEngineService.java | 6 +++--- .../elasticsearch/search/SearchService.java | 14 ++++++------- .../aggregations/support/FieldContext.java | 2 +- .../support/ValuesSourceParser.java | 2 +- .../highlight/FastVectorHighlighter.java | 2 +- .../search/highlight/HighlightPhase.java | 4 ++-- .../search/highlight/HighlightUtils.java | 2 +- .../search/highlight/HighlighterContext.java | 4 ++-- .../search/highlight/PlainHighlighter.java | 6 +++--- .../search/highlight/PostingsHighlighter.java | 4 ++-- .../FragmentBuilderHelper.java | 2 +- .../SimpleFragmentsBuilder.java | 4 ++-- .../SourceScoreOrderFragmentsBuilder.java | 4 ++-- .../SourceSimpleFragmentsBuilder.java | 2 +- .../search/sort/GeoDistanceSortParser.java | 2 +- .../search/sort/SortParseElement.java | 2 +- .../context/GeolocationContextMapping.java | 2 +- .../fielddata/AbstractFieldDataTests.java | 2 +- .../fielddata/IndexFieldDataServiceTests.java | 4 ++-- .../index/mapper/FieldMappersLookupTests.java | 8 ++++---- .../mapper/core/BooleanFieldMapperTests.java | 2 +- .../mapper/date/SimpleDateMappingTests.java | 2 +- .../mapper/externalvalues/ExternalMapper.java | 2 +- .../string/SimpleStringMappingTests.java | 4 ++-- .../elasticsearch/test/TestSearchContext.java | 4 ++-- 89 files changed, 159 insertions(+), 160 deletions(-) diff --git a/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java b/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java index 41c6c80b1b4..3f0ef65f696 100644 --- a/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java +++ b/src/main/java/org/apache/lucene/queries/ExtendedCommonTermsQuery.java @@ -36,9 +36,9 @@ import java.io.IOException; */ public class ExtendedCommonTermsQuery extends CommonTermsQuery { - private final FieldMapper mapper; + private final FieldMapper mapper; - public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, boolean disableCoord, FieldMapper mapper) { + public ExtendedCommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, boolean disableCoord, FieldMapper mapper) { super(highFreqOccur, lowFreqOccur, maxTermFrequency, disableCoord); this.mapper = mapper; } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java index 213ecd513e3..f0cee4f358e 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -109,7 +109,7 @@ public class TransportAnalyzeAction extends TransportSingleCustomOperationAction if (indexService == null) { throw new IllegalArgumentException("No index provided, and trying to analyzer based on a specific field which requires the index parameter"); } - FieldMapper fieldMapper = indexService.mapperService().smartNameFieldMapper(request.field()); + FieldMapper fieldMapper = indexService.mapperService().smartNameFieldMapper(request.field()); if (fieldMapper != null) { if (fieldMapper.isNumeric()) { throw new IllegalArgumentException("Can't process field [" + request.field() + "], Analysis requests are not supported on numeric fields"); diff --git a/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java b/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java index 305d8015edf..5ded196f0f3 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/TransportGetFieldMappingsIndexAction.java @@ -178,29 +178,29 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomO final DocumentFieldMappers allFieldMappers = documentMapper.mappers(); for (String field : request.fields()) { if (Regex.isMatchAllPattern(field)) { - for (FieldMapper fieldMapper : allFieldMappers) { + for (FieldMapper fieldMapper : allFieldMappers) { addFieldMapper(fieldMapper.names().fullName(), fieldMapper, fieldMappings, request.includeDefaults()); } } else if (Regex.isSimpleMatchPattern(field)) { // go through the field mappers 3 times, to make sure we give preference to the resolve order: full name, index name, name. // also make sure we only store each mapper once. - Collection> remainingFieldMappers = Lists.newLinkedList(allFieldMappers); - for (Iterator> it = remainingFieldMappers.iterator(); it.hasNext(); ) { - final FieldMapper fieldMapper = it.next(); + Collection remainingFieldMappers = Lists.newLinkedList(allFieldMappers); + for (Iterator it = remainingFieldMappers.iterator(); it.hasNext(); ) { + final FieldMapper fieldMapper = it.next(); if (Regex.simpleMatch(field, fieldMapper.names().fullName())) { addFieldMapper(fieldMapper.names().fullName(), fieldMapper, fieldMappings, request.includeDefaults()); it.remove(); } } - for (Iterator> it = remainingFieldMappers.iterator(); it.hasNext(); ) { - final FieldMapper fieldMapper = it.next(); + for (Iterator it = remainingFieldMappers.iterator(); it.hasNext(); ) { + final FieldMapper fieldMapper = it.next(); if (Regex.simpleMatch(field, fieldMapper.names().indexName())) { addFieldMapper(fieldMapper.names().indexName(), fieldMapper, fieldMappings, request.includeDefaults()); it.remove(); } } - for (Iterator> it = remainingFieldMappers.iterator(); it.hasNext(); ) { - final FieldMapper fieldMapper = it.next(); + for (Iterator it = remainingFieldMappers.iterator(); it.hasNext(); ) { + final FieldMapper fieldMapper = it.next(); if (Regex.simpleMatch(field, fieldMapper.names().shortName())) { addFieldMapper(fieldMapper.names().shortName(), fieldMapper, fieldMappings, request.includeDefaults()); it.remove(); @@ -209,7 +209,7 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomO } else { // not a pattern - FieldMapper fieldMapper = allFieldMappers.smartNameFieldMapper(field); + FieldMapper fieldMapper = allFieldMappers.smartNameFieldMapper(field); if (fieldMapper != null) { addFieldMapper(field, fieldMapper, fieldMappings, request.includeDefaults()); } else if (request.probablySingleFieldRequest()) { @@ -220,7 +220,7 @@ public class TransportGetFieldMappingsIndexAction extends TransportSingleCustomO return fieldMappings.immutableMap(); } - private void addFieldMapper(String field, FieldMapper fieldMapper, MapBuilder fieldMappings, boolean includeDefaults) { + private void addFieldMapper(String field, FieldMapper fieldMapper, MapBuilder fieldMappings, boolean includeDefaults) { if (fieldMappings.containsKey(field)) { return; } diff --git a/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java index 717eff72a95..daca8e1bfbc 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/IndexFieldData.java @@ -228,7 +228,7 @@ public interface IndexFieldData extends IndexCompone interface Builder { - IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataService.java b/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataService.java index 19f3be065e8..847fa59df48 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataService.java +++ b/src/main/java/org/elasticsearch/index/fielddata/IndexFieldDataService.java @@ -225,7 +225,7 @@ public class IndexFieldDataService extends AbstractIndexComponent { } @SuppressWarnings("unchecked") - public > IFD getForField(FieldMapper mapper) { + public > IFD getForField(FieldMapper mapper) { final FieldMapper.Names fieldNames = mapper.names(); final FieldDataType type = mapper.fieldDataType(); if (type == null) { diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/BytesBinaryDVIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/BytesBinaryDVIndexFieldData.java index 1010bdffa0b..feabfce0092 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/BytesBinaryDVIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/BytesBinaryDVIndexFieldData.java @@ -64,7 +64,7 @@ public class BytesBinaryDVIndexFieldData extends DocValuesIndexFieldData impleme public static class Builder implements IndexFieldData.Builder { @Override - public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { // Ignore breaker final Names fieldNames = mapper.names(); diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/DisabledIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/DisabledIndexFieldData.java index 30d43ecc8fa..c1dfe339131 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/DisabledIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/DisabledIndexFieldData.java @@ -39,7 +39,7 @@ public final class DisabledIndexFieldData extends AbstractIndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { // Ignore Circuit Breaker return new DisabledIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache); diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java index 2f5c07aa7c3..d3bea6283eb 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java @@ -90,7 +90,7 @@ public abstract class DocValuesIndexFieldData { } @Override - public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { // Ignore Circuit Breaker final FieldMapper.Names fieldNames = mapper.names(); diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/DoubleArrayIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/DoubleArrayIndexFieldData.java index ee278820ba7..6d4b9dbc1db 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/DoubleArrayIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/DoubleArrayIndexFieldData.java @@ -72,7 +72,7 @@ public class DoubleArrayIndexFieldData extends AbstractIndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new DoubleArrayIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/FSTBytesIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/FSTBytesIndexFieldData.java index 8e26ec49ff7..3f460376e5c 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/FSTBytesIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/FSTBytesIndexFieldData.java @@ -46,7 +46,7 @@ public class FSTBytesIndexFieldData extends AbstractIndexOrdinalsFieldData { public static class Builder implements IndexFieldData.Builder { @Override - public IndexOrdinalsFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, + public IndexOrdinalsFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new FSTBytesIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/FloatArrayIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/FloatArrayIndexFieldData.java index 8322540ef35..8f7bee30247 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/FloatArrayIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/FloatArrayIndexFieldData.java @@ -71,7 +71,7 @@ public class FloatArrayIndexFieldData extends AbstractIndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new FloatArrayIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointBinaryDVIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointBinaryDVIndexFieldData.java index 97b2ea1bae0..37a3fccd0eb 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointBinaryDVIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointBinaryDVIndexFieldData.java @@ -62,7 +62,7 @@ public class GeoPointBinaryDVIndexFieldData extends DocValuesIndexFieldData impl public static class Builder implements IndexFieldData.Builder { @Override - public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { // Ignore breaker final FieldMapper.Names fieldNames = mapper.names(); diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointCompressedIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointCompressedIndexFieldData.java index fe913672ed4..1b48b014239 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointCompressedIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointCompressedIndexFieldData.java @@ -52,7 +52,7 @@ public class GeoPointCompressedIndexFieldData extends AbstractIndexGeoPointField public static class Builder implements IndexFieldData.Builder { @Override - public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { FieldDataType type = mapper.fieldDataType(); final String precisionAsString = type.getSettings().get(PRECISION_KEY); diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointDoubleArrayIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointDoubleArrayIndexFieldData.java index 16d9aeadca1..7a0beb06353 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointDoubleArrayIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/GeoPointDoubleArrayIndexFieldData.java @@ -46,7 +46,7 @@ public class GeoPointDoubleArrayIndexFieldData extends AbstractIndexGeoPointFiel public static class Builder implements IndexFieldData.Builder { @Override - public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new GeoPointDoubleArrayIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java index 1246fb06354..295b2392b88 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java @@ -46,7 +46,7 @@ public class IndexIndexFieldData extends AbstractIndexOrdinalsFieldData { public static class Builder implements IndexFieldData.Builder { @Override - public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, + public IndexFieldData build(Index index, Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new IndexIndexFieldData(index, mapper.names()); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java index f7cd9ff63eb..922c0be9390 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/PackedArrayIndexFieldData.java @@ -85,7 +85,7 @@ public class PackedArrayIndexFieldData extends AbstractIndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new PackedArrayIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, numericType, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/PagedBytesIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/PagedBytesIndexFieldData.java index 6bea9b1e32f..8d91132b698 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/PagedBytesIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/PagedBytesIndexFieldData.java @@ -47,7 +47,7 @@ public class PagedBytesIndexFieldData extends AbstractIndexOrdinalsFieldData { public static class Builder implements IndexFieldData.Builder { @Override - public IndexOrdinalsFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, + public IndexOrdinalsFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new PagedBytesIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, breakerService); } diff --git a/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java b/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java index 4d34bafddde..e748805e329 100644 --- a/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java +++ b/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java @@ -225,7 +225,7 @@ public class ParentChildIndexFieldData extends AbstractIndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, + public IndexFieldData build(Index index, @IndexSettings Settings indexSettings, FieldMapper mapper, IndexFieldDataCache cache, CircuitBreakerService breakerService, MapperService mapperService) { return new ParentChildIndexFieldData(index, indexSettings, mapper.names(), mapper.fieldDataType(), cache, diff --git a/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java b/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java index 60a6576380f..ad9ad60f172 100644 --- a/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java +++ b/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java @@ -74,7 +74,7 @@ public abstract class FieldsVisitor extends StoredFieldVisitor { public void postProcess(DocumentMapper documentMapper) { for (Map.Entry> entry : fields().entrySet()) { - FieldMapper fieldMapper = documentMapper.mappers().indexName(entry.getKey()).mapper(); + FieldMapper fieldMapper = documentMapper.mappers().indexName(entry.getKey()).mapper(); if (fieldMapper == null) { continue; } diff --git a/src/main/java/org/elasticsearch/index/get/ShardGetService.java b/src/main/java/org/elasticsearch/index/get/ShardGetService.java index eb8da964983..9b7c75621c2 100644 --- a/src/main/java/org/elasticsearch/index/get/ShardGetService.java +++ b/src/main/java/org/elasticsearch/index/get/ShardGetService.java @@ -242,7 +242,7 @@ public class ShardGetService extends AbstractIndexShardComponent { searchLookup.source().setSource(source.source); } - FieldMapper fieldMapper = docMapper.mappers().smartNameFieldMapper(field); + FieldMapper fieldMapper = docMapper.mappers().smartNameFieldMapper(field); if (fieldMapper == null) { if (docMapper.objectMappers().get(field) != null) { // Only fail if we know it is a object field, missing paths / fields shouldn't fail. @@ -314,7 +314,7 @@ public class ShardGetService extends AbstractIndexShardComponent { } } - protected boolean shouldGetFromSource(boolean ignoreErrorsOnGeneratedFields, DocumentMapper docMapper, FieldMapper fieldMapper) { + protected boolean shouldGetFromSource(boolean ignoreErrorsOnGeneratedFields, DocumentMapper docMapper, FieldMapper fieldMapper) { if (!fieldMapper.isGenerated()) { //if the field is always there we check if either source mapper is enabled, in which case we get the field // from source, or, if the field is stored, in which case we have to get if from source here also (we are in the translog phase, doc not indexed yet, we annot access the stored fields) diff --git a/src/main/java/org/elasticsearch/index/mapper/DocumentFieldMappers.java b/src/main/java/org/elasticsearch/index/mapper/DocumentFieldMappers.java index aebc4bcb5fc..c5387cf3459 100644 --- a/src/main/java/org/elasticsearch/index/mapper/DocumentFieldMappers.java +++ b/src/main/java/org/elasticsearch/index/mapper/DocumentFieldMappers.java @@ -34,7 +34,7 @@ import java.util.Map; /** * */ -public final class DocumentFieldMappers implements Iterable> { +public final class DocumentFieldMappers implements Iterable { private final FieldMappersLookup fieldMappers; @@ -55,23 +55,23 @@ public final class DocumentFieldMappers implements Iterable> { this.searchQuoteAnalyzer = searchQuoteAnalyzer; } - public DocumentFieldMappers copyAndAllAll(Collection> newMappers) { + public DocumentFieldMappers copyAndAllAll(Collection newMappers) { FieldMappersLookup fieldMappers = this.fieldMappers.copyAndAddAll(newMappers); - FieldNameAnalyzer indexAnalyzer = this.indexAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function, Map.Entry>() { + FieldNameAnalyzer indexAnalyzer = this.indexAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function>() { @Override - public Map.Entry apply(FieldMapper input) { + public Map.Entry apply(FieldMapper input) { return Maps.immutableEntry(input.names().indexName(), input.indexAnalyzer()); } })); - FieldNameAnalyzer searchAnalyzer = this.searchAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function, Map.Entry>() { + FieldNameAnalyzer searchAnalyzer = this.searchAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function>() { @Override - public Map.Entry apply(FieldMapper input) { + public Map.Entry apply(FieldMapper input) { return Maps.immutableEntry(input.names().indexName(), input.searchAnalyzer()); } })); - FieldNameAnalyzer searchQuoteAnalyzer = this.searchQuoteAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function, Map.Entry>() { + FieldNameAnalyzer searchQuoteAnalyzer = this.searchQuoteAnalyzer.copyAndAddAll(Collections2.transform(newMappers, new Function>() { @Override - public Map.Entry apply(FieldMapper input) { + public Map.Entry apply(FieldMapper input) { return Maps.immutableEntry(input.names().indexName(), input.searchQuoteAnalyzer()); } })); @@ -113,7 +113,7 @@ public final class DocumentFieldMappers implements Iterable> { return fieldMappers.smartName(name); } - public FieldMapper smartNameFieldMapper(String name) { + public FieldMapper smartNameFieldMapper(String name) { return fieldMappers.smartNameFieldMapper(name); } @@ -145,7 +145,7 @@ public final class DocumentFieldMappers implements Iterable> { return this.searchQuoteAnalyzer; } - public Iterator> iterator() { + public Iterator iterator() { return fieldMappers.iterator(); } } diff --git a/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java b/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java index 5bacc20e3af..f69fc2e5411 100644 --- a/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java @@ -196,7 +196,7 @@ public class DocumentMapper implements ToXContent { // collect all the mappers for this type List newObjectMappers = new ArrayList<>(); - List> newFieldMappers = new ArrayList<>(); + List newFieldMappers = new ArrayList<>(); for (RootMapper rootMapper : this.mapping.rootMappers) { if (rootMapper instanceof FieldMapper) { newFieldMappers.add((FieldMapper) rootMapper); @@ -387,7 +387,7 @@ public class DocumentMapper implements ToXContent { return DocumentParser.transformSourceAsMap(mapping, sourceAsMap); } - private void addFieldMappers(Collection> fieldMappers) { + private void addFieldMappers(Collection fieldMappers) { assert mappingLock.isWriteLockedByCurrentThread(); this.fieldMappers = this.fieldMappers.copyAndAllAll(fieldMappers); mapperService.addFieldMappers(fieldMappers); @@ -410,11 +410,11 @@ public class DocumentMapper implements ToXContent { return new MergeResult(simulate) { final List conflicts = new ArrayList<>(); - final List> newFieldMappers = new ArrayList<>(); + final List newFieldMappers = new ArrayList<>(); final List newObjectMappers = new ArrayList<>(); @Override - public void addFieldMappers(Collection> fieldMappers) { + public void addFieldMappers(Collection fieldMappers) { assert simulate() == false; newFieldMappers.addAll(fieldMappers); } @@ -426,7 +426,7 @@ public class DocumentMapper implements ToXContent { } @Override - public Collection> getNewFieldMappers() { + public Collection getNewFieldMappers() { return newFieldMappers; } diff --git a/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index c2a44d4b08b..7c4b641056e 100644 --- a/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -600,7 +600,7 @@ class DocumentParser implements Closeable { } /** Creates instances of the fields that the current field should be copied to */ - private static void parseCopyFields(ParseContext context, FieldMapper fieldMapper, ImmutableList copyToFields) throws IOException { + private static void parseCopyFields(ParseContext context, FieldMapper fieldMapper, ImmutableList copyToFields) throws IOException { if (!context.isWithinCopyTo() && copyToFields.isEmpty() == false) { context = context.createCopyToContext(); for (String field : copyToFields) { diff --git a/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index 29a74e1c973..172c05c32ba 100644 --- a/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -24,7 +24,6 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; -import org.apache.lucene.search.Filter; import org.apache.lucene.search.MultiTermQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; @@ -42,7 +41,7 @@ import java.util.List; /** * */ -public interface FieldMapper extends Mapper { +public interface FieldMapper extends Mapper { String DOC_VALUES_FORMAT = "doc_values_format"; @@ -195,7 +194,7 @@ public interface FieldMapper extends Mapper { /** * Returns the actual value of the field. */ - T value(Object value); + Object value(Object value); /** * Returns the value that will be used as a result for search. Can be only of specific types... . diff --git a/src/main/java/org/elasticsearch/index/mapper/FieldMappersLookup.java b/src/main/java/org/elasticsearch/index/mapper/FieldMappersLookup.java index 60c1d143ead..18f71d142db 100644 --- a/src/main/java/org/elasticsearch/index/mapper/FieldMappersLookup.java +++ b/src/main/java/org/elasticsearch/index/mapper/FieldMappersLookup.java @@ -32,7 +32,7 @@ import java.util.List; /** * A class that holds a map of field mappers from name, index name, and full name. */ -class FieldMappersLookup implements Iterable> { +class FieldMappersLookup implements Iterable { /** Full field name to mappers */ private final CopyOnWriteHashMap mappers; @@ -49,10 +49,10 @@ class FieldMappersLookup implements Iterable> { /** * Return a new instance that contains the union of this instance and the provided mappers. */ - public FieldMappersLookup copyAndAddAll(Collection> newMappers) { + public FieldMappersLookup copyAndAddAll(Collection newMappers) { CopyOnWriteHashMap map = this.mappers; - for (FieldMapper mapper : newMappers) { + for (FieldMapper mapper : newMappers) { String key = mapper.names().fullName(); FieldMappers mappers = map.get(key); @@ -116,7 +116,7 @@ class FieldMappersLookup implements Iterable> { */ public List simpleMatchToIndexNames(String pattern) { List fields = Lists.newArrayList(); - for (FieldMapper fieldMapper : this) { + for (FieldMapper fieldMapper : this) { if (Regex.simpleMatch(pattern, fieldMapper.names().fullName())) { fields.add(fieldMapper.names().indexName()); } else if (Regex.simpleMatch(pattern, fieldMapper.names().indexName())) { @@ -131,7 +131,7 @@ class FieldMappersLookup implements Iterable> { */ public List simpleMatchToFullName(String pattern) { List fields = Lists.newArrayList(); - for (FieldMapper fieldMapper : this) { + for (FieldMapper fieldMapper : this) { if (Regex.simpleMatch(pattern, fieldMapper.names().fullName())) { fields.add(fieldMapper.names().fullName()); } else if (Regex.simpleMatch(pattern, fieldMapper.names().indexName())) { @@ -158,7 +158,7 @@ class FieldMappersLookup implements Iterable> { * and return the first mapper for it (see {@link org.elasticsearch.index.mapper.FieldMappers#mapper()}). */ @Nullable - public FieldMapper smartNameFieldMapper(String name) { + public FieldMapper smartNameFieldMapper(String name) { FieldMappers fieldMappers = smartName(name); if (fieldMappers == null) { return null; @@ -166,12 +166,12 @@ class FieldMappersLookup implements Iterable> { return fieldMappers.mapper(); } - public Iterator> iterator() { + public Iterator iterator() { final Iterator fieldsItr = mappers.values().iterator(); if (fieldsItr.hasNext() == false) { return Collections.emptyIterator(); } - return new Iterator>() { + return new Iterator() { Iterator fieldValuesItr = fieldsItr.next().iterator(); @Override public boolean hasNext() { diff --git a/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/src/main/java/org/elasticsearch/index/mapper/MapperService.java index 5100ae8e811..87b344b0cd3 100755 --- a/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -114,7 +114,7 @@ public class MapperService extends AbstractIndexComponent { private final List typeListeners = new CopyOnWriteArrayList<>(); - private volatile ImmutableMap> unmappedFieldMappers = ImmutableMap.of(); + private volatile ImmutableMap unmappedFieldMappers = ImmutableMap.of(); @Inject public MapperService(Index index, @IndexSettings Settings indexSettings, AnalysisService analysisService, IndexFieldDataService fieldDataService, @@ -269,10 +269,10 @@ public class MapperService extends AbstractIndexComponent { return oldMapper; } else { List newObjectMappers = new ArrayList<>(); - List> newFieldMappers = new ArrayList<>(); + List newFieldMappers = new ArrayList<>(); for (RootMapper rootMapper : mapper.mapping().rootMappers) { - if (rootMapper instanceof FieldMapper) { - newFieldMappers.add((FieldMapper)rootMapper); + if (rootMapper instanceof FieldMapper) { + newFieldMappers.add((FieldMapper)rootMapper); } } MapperUtils.collect(mapper.mapping().root, newObjectMappers, newFieldMappers); @@ -307,7 +307,7 @@ public class MapperService extends AbstractIndexComponent { this.fullPathObjectMappers = fullPathObjectMappers.build(); } - protected void addFieldMappers(Collection> fieldMappers) { + protected void addFieldMappers(Collection fieldMappers) { assert mappingLock.isWriteLockedByCurrentThread(); this.fieldMappers = this.fieldMappers.copyAndAddAll(fieldMappers); } @@ -567,9 +567,9 @@ public class MapperService extends AbstractIndexComponent { /** * Given a type (eg. long, string, ...), return an anonymous field mapper that can be used for search operations. */ - public FieldMapper unmappedFieldMapper(String type) { - final ImmutableMap> unmappedFieldMappers = this.unmappedFieldMappers; - FieldMapper mapper = unmappedFieldMappers.get(type); + public FieldMapper unmappedFieldMapper(String type) { + final ImmutableMap unmappedFieldMappers = this.unmappedFieldMappers; + FieldMapper mapper = unmappedFieldMappers.get(type); if (mapper == null) { final Mapper.TypeParser.ParserContext parserContext = documentMapperParser().parserContext(); Mapper.TypeParser typeParser = parserContext.typeParser(type); @@ -578,11 +578,11 @@ public class MapperService extends AbstractIndexComponent { } final Mapper.Builder builder = typeParser.parse("__anonymous_" + type, ImmutableMap.of(), parserContext); final BuilderContext builderContext = new BuilderContext(indexSettings, new ContentPath(1)); - mapper = (FieldMapper) builder.build(builderContext); + mapper = (FieldMapper) builder.build(builderContext); // There is no need to synchronize writes here. In the case of concurrent access, we could just // compute some mappers several times, which is not a big deal - this.unmappedFieldMappers = ImmutableMap.>builder() + this.unmappedFieldMappers = ImmutableMap.builder() .putAll(unmappedFieldMappers) .put(type, mapper) .build(); diff --git a/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java b/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java index 9ee7e052969..6ea2245e066 100644 --- a/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java +++ b/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java @@ -43,7 +43,7 @@ public enum MapperUtils { } @Override - public void addFieldMappers(Collection> fieldMappers) { + public void addFieldMappers(Collection fieldMappers) { // no-op } @@ -53,7 +53,7 @@ public enum MapperUtils { } @Override - public Collection> getNewFieldMappers() { + public Collection getNewFieldMappers() { throw new UnsupportedOperationException("Strict merge result does not support new field mappers"); } @@ -86,13 +86,13 @@ public enum MapperUtils { } /** Split mapper and its descendants into object and field mappers. */ - public static void collect(Mapper mapper, Collection objectMappers, Collection> fieldMappers) { + public static void collect(Mapper mapper, Collection objectMappers, Collection fieldMappers) { if (mapper instanceof RootObjectMapper) { // root mapper isn't really an object mapper } else if (mapper instanceof ObjectMapper) { objectMappers.add((ObjectMapper)mapper); - } else if (mapper instanceof FieldMapper) { - fieldMappers.add((FieldMapper)mapper); + } else if (mapper instanceof FieldMapper) { + fieldMappers.add((FieldMapper)mapper); } for (Mapper child : mapper) { collect(child, objectMappers, fieldMappers); diff --git a/src/main/java/org/elasticsearch/index/mapper/MergeResult.java b/src/main/java/org/elasticsearch/index/mapper/MergeResult.java index 556491ce1f2..af7bac84649 100644 --- a/src/main/java/org/elasticsearch/index/mapper/MergeResult.java +++ b/src/main/java/org/elasticsearch/index/mapper/MergeResult.java @@ -34,11 +34,11 @@ public abstract class MergeResult { this.simulate = simulate; } - public abstract void addFieldMappers(Collection> fieldMappers); + public abstract void addFieldMappers(Collection fieldMappers); public abstract void addObjectMappers(Collection objectMappers); - public abstract Collection> getNewFieldMappers(); + public abstract Collection getNewFieldMappers(); public abstract Collection getNewObjectMappers(); diff --git a/src/main/java/org/elasticsearch/index/mapper/core/AbstractFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/AbstractFieldMapper.java index c387043f91a..5c26e0c14b4 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/AbstractFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/AbstractFieldMapper.java @@ -78,7 +78,7 @@ import java.util.TreeMap; /** * */ -public abstract class AbstractFieldMapper implements FieldMapper { +public abstract class AbstractFieldMapper implements FieldMapper { public static class Defaults { public static final FieldType FIELD_TYPE = new FieldType(); @@ -879,7 +879,7 @@ public abstract class AbstractFieldMapper implements FieldMapper { public void merge(Mapper mergeWith, MergeResult mergeResult) throws MergeMappingException { AbstractFieldMapper mergeWithMultiField = (AbstractFieldMapper) mergeWith; - List> newFieldMappers = null; + List newFieldMappers = null; ImmutableOpenMap.Builder newMappersBuilder = null; for (ObjectCursor cursor : mergeWithMultiField.multiFields.mappers.values()) { diff --git a/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java index 83dfb2c0782..120cece31e5 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java @@ -61,7 +61,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class BinaryFieldMapper extends AbstractFieldMapper { +public class BinaryFieldMapper extends AbstractFieldMapper { public static final String CONTENT_TYPE = "binary"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java index 85be451d2bb..ff4f485b17e 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java @@ -54,7 +54,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * A field mapper for boolean fields. */ -public class BooleanFieldMapper extends AbstractFieldMapper { +public class BooleanFieldMapper extends AbstractFieldMapper { public static final String CONTENT_TYPE = "boolean"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java index 618d28d19ad..b1ad42a4d5c 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/ByteFieldMapper.java @@ -61,7 +61,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class ByteFieldMapper extends NumberFieldMapper { +public class ByteFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "byte"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java index c10908cec04..e8d0cf54990 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java @@ -67,7 +67,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; /** * */ -public class CompletionFieldMapper extends AbstractFieldMapper { +public class CompletionFieldMapper extends AbstractFieldMapper { public static final String CONTENT_TYPE = "completion"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java index ecdbb8668f8..3d7862bc54e 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java @@ -71,7 +71,7 @@ import static org.elasticsearch.index.mapper.MapperBuilders.dateField; import static org.elasticsearch.index.mapper.core.TypeParsers.parseDateTimeFormatter; import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; -public class DateFieldMapper extends NumberFieldMapper { +public class DateFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "date"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java index 914b39c3014..ffb6496853c 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/DoubleFieldMapper.java @@ -66,7 +66,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class DoubleFieldMapper extends NumberFieldMapper { +public class DoubleFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "double"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java index 31665d22b31..88fba259ff7 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/FloatFieldMapper.java @@ -67,7 +67,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class FloatFieldMapper extends NumberFieldMapper { +public class FloatFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "float"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java index 366e2e33ec9..5f05e72b4d3 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/IntegerFieldMapper.java @@ -62,7 +62,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class IntegerFieldMapper extends NumberFieldMapper { +public class IntegerFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "integer"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java index 4cab235f8d2..46dcf502494 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/LongFieldMapper.java @@ -62,7 +62,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class LongFieldMapper extends NumberFieldMapper { +public class LongFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "long"; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java index 05f4044d142..ecb2e742e79 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java @@ -61,7 +61,7 @@ import java.util.List; /** * */ -public abstract class NumberFieldMapper extends AbstractFieldMapper implements AllFieldMapper.IncludeInAll { +public abstract class NumberFieldMapper extends AbstractFieldMapper implements AllFieldMapper.IncludeInAll { public static class Defaults extends AbstractFieldMapper.Defaults { diff --git a/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java index ef26105676a..24970718744 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/ShortFieldMapper.java @@ -63,7 +63,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class ShortFieldMapper extends NumberFieldMapper { +public class ShortFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "short"; public static final int DEFAULT_PRECISION_STEP = 8; diff --git a/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java index 7c1e99ea663..5dfffc83809 100644 --- a/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java @@ -54,7 +54,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; /** * */ -public class StringFieldMapper extends AbstractFieldMapper implements AllFieldMapper.IncludeInAll { +public class StringFieldMapper extends AbstractFieldMapper implements AllFieldMapper.IncludeInAll { public static final String CONTENT_TYPE = "string"; diff --git a/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java index f556678d371..db0c9899c15 100644 --- a/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java @@ -82,7 +82,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parsePathType; * "lon" : 2.1 * } */ -public class GeoPointFieldMapper extends AbstractFieldMapper implements ArrayValueMapperParser { +public class GeoPointFieldMapper extends AbstractFieldMapper implements ArrayValueMapperParser { public static final String CONTENT_TYPE = "geo_point"; diff --git a/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java index 8e229c09740..42a4fb287ea 100644 --- a/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java @@ -71,7 +71,7 @@ import static org.elasticsearch.index.mapper.MapperBuilders.geoShapeField; * ] * } */ -public class GeoShapeFieldMapper extends AbstractFieldMapper { +public class GeoShapeFieldMapper extends AbstractFieldMapper { public static final String CONTENT_TYPE = "geo_shape"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java index f574b4877a4..c310d96476c 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java @@ -60,7 +60,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class AllFieldMapper extends AbstractFieldMapper implements RootMapper { +public class AllFieldMapper extends AbstractFieldMapper implements RootMapper { public interface IncludeInAll extends Mapper { diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java index c30e820b033..2d4a6975d94 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java @@ -55,7 +55,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; * * Added in Elasticsearch 1.3. */ -public class FieldNamesFieldMapper extends AbstractFieldMapper implements RootMapper { +public class FieldNamesFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_field_names"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java index be54bfbae4d..cd59591b6bb 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java @@ -65,7 +65,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class IdFieldMapper extends AbstractFieldMapper implements RootMapper { +public class IdFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_id"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java index 96bea6d4d1a..34ab0bcb4ae 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java @@ -50,7 +50,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class IndexFieldMapper extends AbstractFieldMapper implements RootMapper { +public class IndexFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_index"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java index 4da382027ef..940c2f6484e 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java @@ -60,7 +60,7 @@ import static org.elasticsearch.index.mapper.MapperBuilders.parent; /** * */ -public class ParentFieldMapper extends AbstractFieldMapper implements RootMapper { +public class ParentFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_parent"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java index 7c3f4dadb29..96b9375d9ad 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java @@ -50,7 +50,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class RoutingFieldMapper extends AbstractFieldMapper implements RootMapper { +public class RoutingFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_routing"; public static final String CONTENT_TYPE = "_routing"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java index 45e5f26f568..7c8ae58d5fd 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java @@ -66,7 +66,7 @@ import static org.elasticsearch.index.mapper.MapperBuilders.source; /** * */ -public class SourceFieldMapper extends AbstractFieldMapper implements RootMapper { +public class SourceFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_source"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java index 1a5e2c40903..a6b214f97f9 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java @@ -56,7 +56,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class TypeFieldMapper extends AbstractFieldMapper implements RootMapper { +public class TypeFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_type"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java index 0beb35f389b..da9f424d9b2 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java @@ -52,7 +52,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; /** * */ -public class UidFieldMapper extends AbstractFieldMapper implements RootMapper { +public class UidFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_uid"; diff --git a/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java index 4254d2cd9fc..88b0074b634 100644 --- a/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java @@ -44,7 +44,7 @@ import java.util.Map; import static org.elasticsearch.index.mapper.MapperBuilders.version; /** Mapper for the _version field. */ -public class VersionFieldMapper extends AbstractFieldMapper implements RootMapper { +public class VersionFieldMapper extends AbstractFieldMapper implements RootMapper { public static final String NAME = "_version"; public static final String CONTENT_TYPE = "_version"; diff --git a/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java b/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java index 1abe24a4c12..29fd2884e7b 100644 --- a/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java @@ -65,7 +65,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ -public class IpFieldMapper extends NumberFieldMapper { +public class IpFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "ip"; diff --git a/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java b/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java index d48fe729b25..ac887d7d11b 100644 --- a/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java +++ b/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java @@ -513,7 +513,7 @@ public class ObjectMapper implements Mapper, AllFieldMapper.IncludeInAll, Clonea List mappersToPut = new ArrayList<>(); List newObjectMappers = new ArrayList<>(); - List> newFieldMappers = new ArrayList<>(); + List newFieldMappers = new ArrayList<>(); for (Mapper mapper : mergeWithObject) { Mapper mergeWithMapper = mapper; Mapper mergeIntoMapper = mappers.get(mergeWithMapper.name()); diff --git a/src/main/java/org/elasticsearch/index/percolator/QueriesLoaderCollector.java b/src/main/java/org/elasticsearch/index/percolator/QueriesLoaderCollector.java index 200a39be207..e394d7f1c06 100644 --- a/src/main/java/org/elasticsearch/index/percolator/QueriesLoaderCollector.java +++ b/src/main/java/org/elasticsearch/index/percolator/QueriesLoaderCollector.java @@ -54,7 +54,7 @@ final class QueriesLoaderCollector extends SimpleCollector { QueriesLoaderCollector(PercolatorQueriesRegistry percolator, ESLogger logger, MapperService mapperService, IndexFieldDataService indexFieldDataService) { this.percolator = percolator; this.logger = logger; - final FieldMapper uidMapper = mapperService.smartNameFieldMapper(UidFieldMapper.NAME); + final FieldMapper uidMapper = mapperService.smartNameFieldMapper(UidFieldMapper.NAME); this.uidFieldData = indexFieldDataService.getForField(uidMapper); } diff --git a/src/main/java/org/elasticsearch/index/query/CommonTermsQueryParser.java b/src/main/java/org/elasticsearch/index/query/CommonTermsQueryParser.java index 17c5c506ec7..ca0aed86f8e 100644 --- a/src/main/java/org/elasticsearch/index/query/CommonTermsQueryParser.java +++ b/src/main/java/org/elasticsearch/index/query/CommonTermsQueryParser.java @@ -163,7 +163,7 @@ public class CommonTermsQueryParser implements QueryParser { throw new QueryParsingException(parseContext, "No text specified for text query"); } String field; - FieldMapper mapper = parseContext.fieldMapper(fieldName); + FieldMapper mapper = parseContext.fieldMapper(fieldName); if (mapper != null) { field = mapper.names().indexName(); } else { diff --git a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java index fdc63bb81c5..454060b5686 100644 --- a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java +++ b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java @@ -186,7 +186,7 @@ public class QueryParseContext { return indexQueryParser.bitsetFilterCache.getBitDocIdSetFilter(filter); } - public > IFD getForField(FieldMapper mapper) { + public > IFD getForField(FieldMapper mapper) { return indexQueryParser.fieldDataService.getForField(mapper); } diff --git a/src/main/java/org/elasticsearch/index/query/TermsQueryParser.java b/src/main/java/org/elasticsearch/index/query/TermsQueryParser.java index d3c44fa2303..f4170292251 100644 --- a/src/main/java/org/elasticsearch/index/query/TermsQueryParser.java +++ b/src/main/java/org/elasticsearch/index/query/TermsQueryParser.java @@ -158,7 +158,7 @@ public class TermsQueryParser implements QueryParser { throw new QueryParsingException(parseContext, "terms query requires a field name, followed by array of terms"); } - FieldMapper fieldMapper = parseContext.fieldMapper(fieldName); + FieldMapper fieldMapper = parseContext.fieldMapper(fieldName); if (fieldMapper != null) { fieldName = fieldMapper.names().indexName(); } diff --git a/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java b/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java index 70c51deb03d..e474dfb6fcb 100644 --- a/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java +++ b/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionParser.java @@ -162,8 +162,8 @@ public abstract class DecayFunctionParser implements ScoreFunctionParser { return parseDateVariable(fieldName, parser, parseContext, (DateFieldMapper) mapper, mode); } else if (mapper instanceof GeoPointFieldMapper) { return parseGeoVariable(fieldName, parser, parseContext, (GeoPointFieldMapper) mapper, mode); - } else if (mapper instanceof NumberFieldMapper) { - return parseNumberVariable(fieldName, parser, parseContext, (NumberFieldMapper) mapper, mode); + } else if (mapper instanceof NumberFieldMapper) { + return parseNumberVariable(fieldName, parser, parseContext, (NumberFieldMapper) mapper, mode); } else { throw new QueryParsingException(parseContext, "Field " + fieldName + " is of type " + mapper.fieldType() + ", but only numeric types are supported."); @@ -171,7 +171,7 @@ public abstract class DecayFunctionParser implements ScoreFunctionParser { } private AbstractDistanceScoreFunction parseNumberVariable(String fieldName, XContentParser parser, QueryParseContext parseContext, - NumberFieldMapper mapper, MultiValueMode mode) throws IOException { + NumberFieldMapper mapper, MultiValueMode mode) throws IOException { XContentParser.Token token; String parameterName = null; double scale = 0; diff --git a/src/main/java/org/elasticsearch/index/query/functionscore/random/RandomScoreFunctionParser.java b/src/main/java/org/elasticsearch/index/query/functionscore/random/RandomScoreFunctionParser.java index e4b26822d66..28bfeb6f0ca 100644 --- a/src/main/java/org/elasticsearch/index/query/functionscore/random/RandomScoreFunctionParser.java +++ b/src/main/java/org/elasticsearch/index/query/functionscore/random/RandomScoreFunctionParser.java @@ -82,7 +82,7 @@ public class RandomScoreFunctionParser implements ScoreFunctionParser { } } - final FieldMapper mapper = SearchContext.current().mapperService().smartNameFieldMapper("_uid"); + final FieldMapper mapper = SearchContext.current().mapperService().smartNameFieldMapper("_uid"); if (mapper == null) { // mapper could be null if we are on a shard with no docs yet, so this won't actually be used return new RandomScoreFunction(); diff --git a/src/main/java/org/elasticsearch/index/search/MatchQuery.java b/src/main/java/org/elasticsearch/index/search/MatchQuery.java index 5f08c6f4703..b2b747a9c92 100644 --- a/src/main/java/org/elasticsearch/index/search/MatchQuery.java +++ b/src/main/java/org/elasticsearch/index/search/MatchQuery.java @@ -253,7 +253,7 @@ public class MatchQuery { return query; } - public Query createCommonTermsQuery(String field, String queryText, Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, FieldMapper mapper) { + public Query createCommonTermsQuery(String field, String queryText, Occur highFreqOccur, Occur lowFreqOccur, float maxTermFrequency, FieldMapper mapper) { Query booleanQuery = createBooleanQuery(field, queryText, lowFreqOccur); if (booleanQuery != null && booleanQuery instanceof BooleanQuery) { BooleanQuery bq = (BooleanQuery) booleanQuery; diff --git a/src/main/java/org/elasticsearch/percolator/PercolatorService.java b/src/main/java/org/elasticsearch/percolator/PercolatorService.java index 5503f8ecf8b..e4d1f0ba980 100644 --- a/src/main/java/org/elasticsearch/percolator/PercolatorService.java +++ b/src/main/java/org/elasticsearch/percolator/PercolatorService.java @@ -752,7 +752,7 @@ public class PercolatorService extends AbstractComponent { hls = new ArrayList<>(topDocs.scoreDocs.length); } - final FieldMapper uidMapper = context.mapperService().smartNameFieldMapper(UidFieldMapper.NAME); + final FieldMapper uidMapper = context.mapperService().smartNameFieldMapper(UidFieldMapper.NAME); final IndexFieldData uidFieldData = context.fieldData().getForField(uidMapper); int i = 0; for (ScoreDoc scoreDoc : topDocs.scoreDocs) { diff --git a/src/main/java/org/elasticsearch/percolator/QueryCollector.java b/src/main/java/org/elasticsearch/percolator/QueryCollector.java index e21e77612d6..9299bf92bcb 100644 --- a/src/main/java/org/elasticsearch/percolator/QueryCollector.java +++ b/src/main/java/org/elasticsearch/percolator/QueryCollector.java @@ -73,7 +73,7 @@ abstract class QueryCollector extends SimpleCollector { this.logger = logger; this.queries = context.percolateQueries(); this.searcher = context.docSearcher(); - final FieldMapper uidMapper = context.mapperService().smartNameFieldMapper(UidFieldMapper.NAME); + final FieldMapper uidMapper = context.mapperService().smartNameFieldMapper(UidFieldMapper.NAME); this.uidFieldData = context.fieldData().getForField(uidMapper); this.isNestedDoc = isNestedDoc; diff --git a/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java b/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java index 5e94422314a..d0c569b57d5 100644 --- a/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java +++ b/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java @@ -152,7 +152,7 @@ public class ExpressionScriptEngineService extends AbstractComponent implements throw new ExpressionScriptCompilationException("Variable [" + variable + "] does not follow an allowed format of either doc['field'] or doc['field'].method()"); } - FieldMapper field = mapper.smartNameFieldMapper(fieldname); + FieldMapper field = mapper.smartNameFieldMapper(fieldname); if (field == null) { throw new ExpressionScriptCompilationException("Field [" + fieldname + "] used in expression does not exist in mappings"); @@ -174,7 +174,7 @@ public class ExpressionScriptEngineService extends AbstractComponent implements return new ExpressionScript((Expression)compiledScript, bindings, specialValue); } - protected ValueSource getMethodValueSource(FieldMapper field, IndexFieldData fieldData, String fieldName, String methodName) { + protected ValueSource getMethodValueSource(FieldMapper field, IndexFieldData fieldData, String fieldName, String methodName) { switch (methodName) { case GET_YEAR_METHOD: return getDateMethodValueSource(field, fieldData, fieldName, methodName, Calendar.YEAR); @@ -205,7 +205,7 @@ public class ExpressionScriptEngineService extends AbstractComponent implements } } - protected ValueSource getDateMethodValueSource(FieldMapper field, IndexFieldData fieldData, String fieldName, String methodName, int calendarType) { + protected ValueSource getDateMethodValueSource(FieldMapper field, IndexFieldData fieldData, String fieldName, String methodName, int calendarType) { if (!(field instanceof DateFieldMapper)) { throw new IllegalArgumentException("Member method [" + methodName + "] can only be used with a date field type, not the field [" + fieldName + "]."); } diff --git a/src/main/java/org/elasticsearch/search/SearchService.java b/src/main/java/org/elasticsearch/search/SearchService.java index 09e3f2d9a5b..15a691f3360 100644 --- a/src/main/java/org/elasticsearch/search/SearchService.java +++ b/src/main/java/org/elasticsearch/search/SearchService.java @@ -839,7 +839,7 @@ public class SearchService extends AbstractLifecycleComponent { final MapperService mapperService = indexShard.mapperService(); final ObjectSet warmUp = new ObjectHashSet<>(); for (DocumentMapper docMapper : mapperService.docMappers(false)) { - for (FieldMapper fieldMapper : docMapper.mappers()) { + for (FieldMapper fieldMapper : docMapper.mappers()) { final String indexName = fieldMapper.names().indexName(); if (fieldMapper.fieldType().indexOptions() != IndexOptions.NONE && !fieldMapper.fieldType().omitNorms() && fieldMapper.normsLoading(defaultLoading) == Loading.EAGER) { warmUp.add(indexName); @@ -893,9 +893,9 @@ public class SearchService extends AbstractLifecycleComponent { @Override public TerminationHandle warmNewReaders(final IndexShard indexShard, IndexMetaData indexMetaData, final WarmerContext context, ThreadPool threadPool) { final MapperService mapperService = indexShard.mapperService(); - final Map> warmUp = new HashMap<>(); + final Map warmUp = new HashMap<>(); for (DocumentMapper docMapper : mapperService.docMappers(false)) { - for (FieldMapper fieldMapper : docMapper.mappers()) { + for (FieldMapper fieldMapper : docMapper.mappers()) { final FieldDataType fieldDataType = fieldMapper.fieldDataType(); if (fieldDataType == null) { continue; @@ -915,7 +915,7 @@ public class SearchService extends AbstractLifecycleComponent { final Executor executor = threadPool.executor(executor()); final CountDownLatch latch = new CountDownLatch(context.searcher().reader().leaves().size() * warmUp.size()); for (final LeafReaderContext ctx : context.searcher().reader().leaves()) { - for (final FieldMapper fieldMapper : warmUp.values()) { + for (final FieldMapper fieldMapper : warmUp.values()) { executor.execute(new Runnable() { @Override @@ -947,9 +947,9 @@ public class SearchService extends AbstractLifecycleComponent { @Override public TerminationHandle warmTopReader(final IndexShard indexShard, IndexMetaData indexMetaData, final WarmerContext context, ThreadPool threadPool) { final MapperService mapperService = indexShard.mapperService(); - final Map> warmUpGlobalOrdinals = new HashMap<>(); + final Map warmUpGlobalOrdinals = new HashMap<>(); for (DocumentMapper docMapper : mapperService.docMappers(false)) { - for (FieldMapper fieldMapper : docMapper.mappers()) { + for (FieldMapper fieldMapper : docMapper.mappers()) { final FieldDataType fieldDataType = fieldMapper.fieldDataType(); if (fieldDataType == null) { continue; @@ -967,7 +967,7 @@ public class SearchService extends AbstractLifecycleComponent { final IndexFieldDataService indexFieldDataService = indexShard.indexFieldDataService(); final Executor executor = threadPool.executor(executor()); final CountDownLatch latch = new CountDownLatch(warmUpGlobalOrdinals.size()); - for (final FieldMapper fieldMapper : warmUpGlobalOrdinals.values()) { + for (final FieldMapper fieldMapper : warmUpGlobalOrdinals.values()) { executor.execute(new Runnable() { @Override public void run() { diff --git a/src/main/java/org/elasticsearch/search/aggregations/support/FieldContext.java b/src/main/java/org/elasticsearch/search/aggregations/support/FieldContext.java index 169d87c40c6..7c8bdf37db7 100644 --- a/src/main/java/org/elasticsearch/search/aggregations/support/FieldContext.java +++ b/src/main/java/org/elasticsearch/search/aggregations/support/FieldContext.java @@ -29,7 +29,7 @@ public class FieldContext { private final String field; private final IndexFieldData indexFieldData; - private final FieldMapper mapper; + private final FieldMapper mapper; /** * Constructs a field data context for the given field and its index field data diff --git a/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceParser.java b/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceParser.java index f7313885cbb..35bc30a48fa 100644 --- a/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceParser.java +++ b/src/main/java/org/elasticsearch/search/aggregations/support/ValuesSourceParser.java @@ -158,7 +158,7 @@ public class ValuesSourceParser { return config; } - FieldMapper mapper = context.smartNameFieldMapperFromAnyType(input.field); + FieldMapper mapper = context.smartNameFieldMapperFromAnyType(input.field); if (mapper == null) { Class valuesSourceType = valueType != null ? (Class) valueType.getValuesSourceType() : this.valuesSourceType; ValuesSourceConfig config = new ValuesSourceConfig<>(valuesSourceType); diff --git a/src/main/java/org/elasticsearch/search/highlight/FastVectorHighlighter.java b/src/main/java/org/elasticsearch/search/highlight/FastVectorHighlighter.java index 161cdd490f1..a61fabb0034 100644 --- a/src/main/java/org/elasticsearch/search/highlight/FastVectorHighlighter.java +++ b/src/main/java/org/elasticsearch/search/highlight/FastVectorHighlighter.java @@ -61,7 +61,7 @@ public class FastVectorHighlighter implements Highlighter { SearchContextHighlight.Field field = highlighterContext.field; SearchContext context = highlighterContext.context; FetchSubPhase.HitContext hitContext = highlighterContext.hitContext; - FieldMapper mapper = highlighterContext.mapper; + FieldMapper mapper = highlighterContext.mapper; if (!(mapper.fieldType().storeTermVectors() && mapper.fieldType().storeTermVectorOffsets() && mapper.fieldType().storeTermVectorPositions())) { throw new IllegalArgumentException("the field [" + highlighterContext.fieldName + "] should be indexed with term vector with position offsets to be used with fast vector highlighter"); diff --git a/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java b/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java index d7d303138d8..a730b6612d0 100644 --- a/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java +++ b/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java @@ -91,7 +91,7 @@ public class HighlightPhase extends AbstractComponent implements FetchSubPhase { } for (String fieldName : fieldNamesToHighlight) { - FieldMapper fieldMapper = getMapperForField(fieldName, context, hitContext); + FieldMapper fieldMapper = getMapperForField(fieldName, context, hitContext); if (fieldMapper == null) { continue; } @@ -130,7 +130,7 @@ public class HighlightPhase extends AbstractComponent implements FetchSubPhase { hitContext.hit().highlightFields(highlightFields); } - private FieldMapper getMapperForField(String fieldName, SearchContext searchContext, HitContext hitContext) { + private FieldMapper getMapperForField(String fieldName, SearchContext searchContext, HitContext hitContext) { DocumentMapper documentMapper = searchContext.mapperService().documentMapper(hitContext.hit().type()); // TODO: no need to lookup the doc mapper with unambiguous field names? just look at the mapper service return documentMapper.mappers().smartNameFieldMapper(fieldName); diff --git a/src/main/java/org/elasticsearch/search/highlight/HighlightUtils.java b/src/main/java/org/elasticsearch/search/highlight/HighlightUtils.java index d4ee0343708..acbba6749cf 100644 --- a/src/main/java/org/elasticsearch/search/highlight/HighlightUtils.java +++ b/src/main/java/org/elasticsearch/search/highlight/HighlightUtils.java @@ -42,7 +42,7 @@ public final class HighlightUtils { } - static List loadFieldValues(SearchContextHighlight.Field field, FieldMapper mapper, SearchContext searchContext, FetchSubPhase.HitContext hitContext) throws IOException { + static List loadFieldValues(SearchContextHighlight.Field field, FieldMapper mapper, SearchContext searchContext, FetchSubPhase.HitContext hitContext) throws IOException { //percolator needs to always load from source, thus it sets the global force source to true boolean forceSource = searchContext.highlight().forceSource(field); List textsToHighlight; diff --git a/src/main/java/org/elasticsearch/search/highlight/HighlighterContext.java b/src/main/java/org/elasticsearch/search/highlight/HighlighterContext.java index aedc7d6ac78..f3dd9ff1ba8 100644 --- a/src/main/java/org/elasticsearch/search/highlight/HighlighterContext.java +++ b/src/main/java/org/elasticsearch/search/highlight/HighlighterContext.java @@ -31,12 +31,12 @@ public class HighlighterContext { public final String fieldName; public final SearchContextHighlight.Field field; - public final FieldMapper mapper; + public final FieldMapper mapper; public final SearchContext context; public final FetchSubPhase.HitContext hitContext; public final HighlightQuery query; - public HighlighterContext(String fieldName, SearchContextHighlight.Field field, FieldMapper mapper, SearchContext context, + public HighlighterContext(String fieldName, SearchContextHighlight.Field field, FieldMapper mapper, SearchContext context, FetchSubPhase.HitContext hitContext, HighlightQuery query) { this.fieldName = fieldName; this.field = field; diff --git a/src/main/java/org/elasticsearch/search/highlight/PlainHighlighter.java b/src/main/java/org/elasticsearch/search/highlight/PlainHighlighter.java index d7e3580ab4d..3e0eca6c468 100644 --- a/src/main/java/org/elasticsearch/search/highlight/PlainHighlighter.java +++ b/src/main/java/org/elasticsearch/search/highlight/PlainHighlighter.java @@ -56,16 +56,16 @@ public class PlainHighlighter implements Highlighter { SearchContextHighlight.Field field = highlighterContext.field; SearchContext context = highlighterContext.context; FetchSubPhase.HitContext hitContext = highlighterContext.hitContext; - FieldMapper mapper = highlighterContext.mapper; + FieldMapper mapper = highlighterContext.mapper; Encoder encoder = field.fieldOptions().encoder().equals("html") ? HighlightUtils.Encoders.HTML : HighlightUtils.Encoders.DEFAULT; if (!hitContext.cache().containsKey(CACHE_KEY)) { - Map, org.apache.lucene.search.highlight.Highlighter> mappers = Maps.newHashMap(); + Map mappers = Maps.newHashMap(); hitContext.cache().put(CACHE_KEY, mappers); } @SuppressWarnings("unchecked") - Map, org.apache.lucene.search.highlight.Highlighter> cache = (Map, org.apache.lucene.search.highlight.Highlighter>) hitContext.cache().get(CACHE_KEY); + Map cache = (Map) hitContext.cache().get(CACHE_KEY); org.apache.lucene.search.highlight.Highlighter entry = cache.get(mapper); if (entry == null) { diff --git a/src/main/java/org/elasticsearch/search/highlight/PostingsHighlighter.java b/src/main/java/org/elasticsearch/search/highlight/PostingsHighlighter.java index 882a4464357..1614f294ff2 100644 --- a/src/main/java/org/elasticsearch/search/highlight/PostingsHighlighter.java +++ b/src/main/java/org/elasticsearch/search/highlight/PostingsHighlighter.java @@ -48,7 +48,7 @@ public class PostingsHighlighter implements Highlighter { @Override public HighlightField highlight(HighlighterContext highlighterContext) { - FieldMapper fieldMapper = highlighterContext.mapper; + FieldMapper fieldMapper = highlighterContext.mapper; SearchContextHighlight.Field field = highlighterContext.field; if (fieldMapper.fieldType().indexOptions() != IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS) { throw new IllegalArgumentException("the field [" + highlighterContext.fieldName + "] should be indexed with positions and offsets in the postings list to be used with postings highlighter"); @@ -169,7 +169,7 @@ public class PostingsHighlighter implements Highlighter { } private static class HighlighterEntry { - Map, MapperHighlighterEntry> mappers = Maps.newHashMap(); + Map mappers = Maps.newHashMap(); } private static class MapperHighlighterEntry { diff --git a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/FragmentBuilderHelper.java b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/FragmentBuilderHelper.java index 2baa99e7758..3d338277033 100644 --- a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/FragmentBuilderHelper.java +++ b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/FragmentBuilderHelper.java @@ -46,7 +46,7 @@ public final class FragmentBuilderHelper { * Fixes problems with broken analysis chains if positions and offsets are messed up that can lead to * {@link StringIndexOutOfBoundsException} in the {@link FastVectorHighlighter} */ - public static WeightedFragInfo fixWeightedFragInfo(FieldMapper mapper, Field[] values, WeightedFragInfo fragInfo) { + public static WeightedFragInfo fixWeightedFragInfo(FieldMapper mapper, Field[] values, WeightedFragInfo fragInfo) { assert fragInfo != null : "FragInfo must not be null"; assert mapper.names().indexName().equals(values[0].name()) : "Expected FieldMapper for field " + values[0].name(); if (!fragInfo.getSubInfos().isEmpty() && (containsBrokenAnalysis(mapper.indexAnalyzer()))) { diff --git a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SimpleFragmentsBuilder.java b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SimpleFragmentsBuilder.java index 5fe5f194564..271b0c7acf5 100644 --- a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SimpleFragmentsBuilder.java +++ b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SimpleFragmentsBuilder.java @@ -29,9 +29,9 @@ import org.elasticsearch.index.mapper.FieldMapper; * that corrects offsets for broken analysis chains. */ public class SimpleFragmentsBuilder extends org.apache.lucene.search.vectorhighlight.SimpleFragmentsBuilder { - protected final FieldMapper mapper; + protected final FieldMapper mapper; - public SimpleFragmentsBuilder(FieldMapper mapper, + public SimpleFragmentsBuilder(FieldMapper mapper, String[] preTags, String[] postTags, BoundaryScanner boundaryScanner) { super(preTags, postTags, boundaryScanner); this.mapper = mapper; diff --git a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceScoreOrderFragmentsBuilder.java b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceScoreOrderFragmentsBuilder.java index 89fa156d5f7..b7670cb08ec 100644 --- a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceScoreOrderFragmentsBuilder.java +++ b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceScoreOrderFragmentsBuilder.java @@ -40,13 +40,13 @@ import java.util.List; */ public class SourceScoreOrderFragmentsBuilder extends ScoreOrderFragmentsBuilder { - private final FieldMapper mapper; + private final FieldMapper mapper; private final SearchContext searchContext; private final FetchSubPhase.HitContext hitContext; - public SourceScoreOrderFragmentsBuilder(FieldMapper mapper, SearchContext searchContext, + public SourceScoreOrderFragmentsBuilder(FieldMapper mapper, SearchContext searchContext, FetchSubPhase.HitContext hitContext, String[] preTags, String[] postTags, BoundaryScanner boundaryScanner) { super(preTags, postTags, boundaryScanner); this.mapper = mapper; diff --git a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceSimpleFragmentsBuilder.java b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceSimpleFragmentsBuilder.java index d196cccd06f..c52312f5ac0 100644 --- a/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceSimpleFragmentsBuilder.java +++ b/src/main/java/org/elasticsearch/search/highlight/vectorhighlight/SourceSimpleFragmentsBuilder.java @@ -41,7 +41,7 @@ public class SourceSimpleFragmentsBuilder extends SimpleFragmentsBuilder { private final FetchSubPhase.HitContext hitContext; - public SourceSimpleFragmentsBuilder(FieldMapper mapper, SearchContext searchContext, + public SourceSimpleFragmentsBuilder(FieldMapper mapper, SearchContext searchContext, FetchSubPhase.HitContext hitContext, String[] preTags, String[] postTags, BoundaryScanner boundaryScanner) { super(mapper, preTags, postTags, boundaryScanner); this.searchContext = searchContext; diff --git a/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortParser.java b/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortParser.java index 3c4bbfe1010..1b97c5170e1 100644 --- a/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortParser.java +++ b/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortParser.java @@ -139,7 +139,7 @@ public class GeoDistanceSortParser implements SortParser { throw new IllegalArgumentException("sort_mode [sum] isn't supported for sorting by geo distance"); } - FieldMapper mapper = context.smartNameFieldMapper(fieldName); + FieldMapper mapper = context.smartNameFieldMapper(fieldName); if (mapper == null) { throw new IllegalArgumentException("failed to find mapper for [" + fieldName + "] for geo distance based sort"); } diff --git a/src/main/java/org/elasticsearch/search/sort/SortParseElement.java b/src/main/java/org/elasticsearch/search/sort/SortParseElement.java index 958f5fd5802..3d97b788825 100644 --- a/src/main/java/org/elasticsearch/search/sort/SortParseElement.java +++ b/src/main/java/org/elasticsearch/search/sort/SortParseElement.java @@ -208,7 +208,7 @@ public class SortParseElement implements SearchParseElement { sortFields.add(SORT_DOC); } } else { - FieldMapper fieldMapper = context.smartNameFieldMapper(fieldName); + FieldMapper fieldMapper = context.smartNameFieldMapper(fieldName); if (fieldMapper == null) { if (unmappedType != null) { fieldMapper = context.mapperService().unmappedFieldMapper(unmappedType); diff --git a/src/main/java/org/elasticsearch/search/suggest/context/GeolocationContextMapping.java b/src/main/java/org/elasticsearch/search/suggest/context/GeolocationContextMapping.java index cfa0c750ee6..74cb0a52ff0 100644 --- a/src/main/java/org/elasticsearch/search/suggest/context/GeolocationContextMapping.java +++ b/src/main/java/org/elasticsearch/search/suggest/context/GeolocationContextMapping.java @@ -253,7 +253,7 @@ public class GeolocationContextMapping extends ContextMapping { public ContextConfig parseContext(ParseContext parseContext, XContentParser parser) throws IOException, ElasticsearchParseException { if(fieldName != null) { - FieldMapper mapper = parseContext.docMapper().mappers().getMapper(fieldName); + FieldMapper mapper = parseContext.docMapper().mappers().getMapper(fieldName); if(!(mapper instanceof GeoPointFieldMapper)) { throw new ElasticsearchParseException("referenced field must be mapped to geo_point"); } diff --git a/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java b/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java index 6765dd3bd73..60a59eaa28d 100644 --- a/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java +++ b/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTests.java @@ -65,7 +65,7 @@ public abstract class AbstractFieldDataTests extends ElasticsearchSingleNodeTest } public > IFD getForField(FieldDataType type, String fieldName, boolean docValues) { - final FieldMapper mapper; + final FieldMapper mapper; final BuilderContext context = new BuilderContext(indexService.settingsService().getSettings(), new ContentPath(1)); if (type.getType().equals("string")) { mapper = MapperBuilders.stringField(fieldName).tokenized(false).docValues(docValues).fieldDataSettings(type.getSettings()).build(context); diff --git a/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java b/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java index bb2a9146868..69d6b9cae27 100644 --- a/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java +++ b/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java @@ -61,7 +61,7 @@ public class IndexFieldDataServiceTests extends ElasticsearchSingleNodeTest { assertTrue(fd instanceof PagedBytesIndexFieldData); } - for (FieldMapper mapper : Arrays.asList( + for (FieldMapper mapper : Arrays.asList( new ByteFieldMapper.Builder("int").docValues(docValues).build(ctx), new ShortFieldMapper.Builder("int").docValues(docValues).build(ctx), new IntegerFieldMapper.Builder("int").docValues(docValues).build(ctx), @@ -107,7 +107,7 @@ public class IndexFieldDataServiceTests extends ElasticsearchSingleNodeTest { assertTrue(fd instanceof FSTBytesIndexFieldData); final Settings fdSettings = ImmutableSettings.builder().put("format", "array").build(); - for (FieldMapper mapper : Arrays.asList( + for (FieldMapper mapper : Arrays.asList( new ByteFieldMapper.Builder("int").fieldDataSettings(DOC_VALUES_SETTINGS).fieldDataSettings(fdSettings).build(ctx), new ShortFieldMapper.Builder("int").fieldDataSettings(DOC_VALUES_SETTINGS).fieldDataSettings(fdSettings).build(ctx), new IntegerFieldMapper.Builder("int").fieldDataSettings(DOC_VALUES_SETTINGS).fieldDataSettings(fdSettings).build(ctx), diff --git a/src/test/java/org/elasticsearch/index/mapper/FieldMappersLookupTests.java b/src/test/java/org/elasticsearch/index/mapper/FieldMappersLookupTests.java index 75c4bd51a87..e28cc7db9b4 100644 --- a/src/test/java/org/elasticsearch/index/mapper/FieldMappersLookupTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/FieldMappersLookupTests.java @@ -49,7 +49,7 @@ public class FieldMappersLookupTests extends ElasticsearchTestCase { assertNull(lookup.smartName("foo")); assertNull(lookup.smartNameFieldMapper("foo")); assertNull(lookup.get("foo")); - Iterator> itr = lookup.iterator(); + Iterator itr = lookup.iterator(); assertNotNull(itr); assertFalse(itr.hasNext()); } @@ -141,7 +141,7 @@ public class FieldMappersLookupTests extends ElasticsearchTestCase { lookup = lookup.copyAndAddAll(newList(f1)); try { - Iterator> itr = lookup.iterator(); + Iterator itr = lookup.iterator(); assertTrue(itr.hasNext()); assertEquals(f1, itr.next()); itr.remove(); @@ -168,12 +168,12 @@ public class FieldMappersLookupTests extends ElasticsearchTestCase { } } - static List> newList(FieldMapper... mapper) { + static List newList(FieldMapper... mapper) { return Lists.newArrayList(mapper); } // this sucks how much must be overriden just do get a dummy field mapper... - static class FakeFieldMapper extends AbstractFieldMapper { + static class FakeFieldMapper extends AbstractFieldMapper { static Settings dummySettings = ImmutableSettings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.CURRENT.id).build(); public FakeFieldMapper(String fullName, String indexName) { super(new Names(fullName, indexName, indexName, fullName), 1.0f, AbstractFieldMapper.Defaults.FIELD_TYPE, null, null, null, null, null, null, dummySettings, null, null); diff --git a/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java b/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java index 7269605fe64..16abe80515a 100644 --- a/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java @@ -87,7 +87,7 @@ public class BooleanFieldMapperTests extends ElasticsearchSingleNodeTest { .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); - FieldMapper mapper = defaultMapper.mappers().getMapper("field"); + FieldMapper mapper = defaultMapper.mappers().getMapper("field"); XContentBuilder builder = XContentFactory.jsonBuilder().startObject(); mapper.toXContent(builder, ToXContent.EMPTY_PARAMS); builder.endObject(); diff --git a/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java index 3d3a41c79f0..29977447681 100644 --- a/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/date/SimpleDateMappingTests.java @@ -88,7 +88,7 @@ public class SimpleDateMappingTests extends ElasticsearchSingleNodeTest { assertNotNull(doc.dynamicMappingsUpdate()); client().admin().indices().preparePutMapping("test-0").setType("type").setSource(doc.dynamicMappingsUpdate().toString()).get(); - FieldMapper fieldMapper = defaultMapper.mappers().smartNameFieldMapper("date_field1"); + FieldMapper fieldMapper = defaultMapper.mappers().smartNameFieldMapper("date_field1"); assertThat(fieldMapper, instanceOf(DateFieldMapper.class)); fieldMapper = defaultMapper.mappers().smartNameFieldMapper("date_field2"); assertThat(fieldMapper, instanceOf(DateFieldMapper.class)); diff --git a/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java b/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java index c799b03a93a..a8bf1476465 100755 --- a/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java +++ b/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java @@ -60,7 +60,7 @@ import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; * .point GeoPoint type * .shape GeoShape type */ -public class ExternalMapper extends AbstractFieldMapper { +public class ExternalMapper extends AbstractFieldMapper { /** * Returns the actual value of the field. * diff --git a/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java b/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java index bfbc5c963d7..9baa2ca6afc 100644 --- a/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java +++ b/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java @@ -281,7 +281,7 @@ public class SimpleStringMappingTests extends ElasticsearchSingleNodeTest { } private Map getSerializedMap(String fieldName, DocumentMapper mapper) throws Exception { - FieldMapper fieldMapper = mapper.mappers().smartNameFieldMapper(fieldName); + FieldMapper fieldMapper = mapper.mappers().smartNameFieldMapper(fieldName); XContentBuilder builder = JsonXContent.contentBuilder().startObject(); fieldMapper.toXContent(builder, ToXContent.EMPTY_PARAMS).endObject(); builder.close(); @@ -525,7 +525,7 @@ public class SimpleStringMappingTests extends ElasticsearchSingleNodeTest { .endObject().endObject().string(); DocumentMapper defaultMapper = parser.parse(mapping); - FieldMapper mapper = defaultMapper.mappers().getMapper("field"); + FieldMapper mapper = defaultMapper.mappers().getMapper("field"); assertNotNull(mapper); assertTrue(mapper instanceof StringFieldMapper); assertEquals(Queries.newMatchNoDocsQuery(), mapper.termsQuery(Collections.emptyList(), null)); diff --git a/src/test/java/org/elasticsearch/test/TestSearchContext.java b/src/test/java/org/elasticsearch/test/TestSearchContext.java index 54fabbd03da..7e3bdda26a1 100644 --- a/src/test/java/org/elasticsearch/test/TestSearchContext.java +++ b/src/test/java/org/elasticsearch/test/TestSearchContext.java @@ -552,7 +552,7 @@ public class TestSearchContext extends SearchContext { } @Override - public FieldMapper smartNameFieldMapper(String name) { + public FieldMapper smartNameFieldMapper(String name) { if (mapperService() != null) { return mapperService().smartNameFieldMapper(name, types()); } @@ -560,7 +560,7 @@ public class TestSearchContext extends SearchContext { } @Override - public FieldMapper smartNameFieldMapperFromAnyType(String name) { + public FieldMapper smartNameFieldMapperFromAnyType(String name) { if (mapperService() != null) { return mapperService().smartNameFieldMapper(name); }