From 0d6ac57acf0d94315abd5d2dda48aac30e56246a Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Wed, 10 Aug 2016 16:19:21 +0200 Subject: [PATCH] Collapse o.e.index.mapper packages. #19921 I also reduced the visibility of a couple classes and renamed/consolidated some test classes for consistency, eg. removing the `Simple` prefix or using the `FieldMapperTests` convention for testing field mappers. --- .../resources/checkstyle_suppressions.xml | 141 +++++---- .../classic/MapperQueryParser.java | 4 +- .../analyze/TransportAnalyzeAction.java | 2 +- .../explain/TransportExplainAction.java | 2 +- .../action/index/IndexRequest.java | 2 +- .../action/update/UpdateHelper.java | 8 +- .../cluster/metadata/MappingMetaData.java | 2 +- .../elasticsearch/common/geo/GeoUtils.java | 3 +- .../common/geo/builders/ShapeBuilder.java | 2 +- .../common/lucene/search/Queries.java | 2 +- .../uid/PerThreadIDAndVersionLookup.java | 4 +- .../common/lucene/uid/Versions.java | 2 +- .../elasticsearch/index/IndexSettings.java | 2 +- .../index/analysis/AnalysisService.java | 2 +- .../analysis/CustomAnalyzerProvider.java | 2 +- .../index/cache/bitset/BitsetFilterCache.java | 2 +- .../PerFieldMappingPostingFormatCodec.java | 4 +- .../plain/DocValuesIndexFieldData.java | 4 +- .../fielddata/plain/IndexIndexFieldData.java | 2 +- .../plain/ParentChildIndexFieldData.java | 2 +- .../index/fieldvisitor/FieldsVisitor.java | 12 +- .../fieldvisitor/JustUidFieldsVisitor.java | 2 +- .../fieldvisitor/SingleFieldsVisitor.java | 6 +- .../index/get/ShardGetService.java | 12 +- .../mapper/{internal => }/AllFieldMapper.java | 10 +- .../{object => }/ArrayValueMapperParser.java | 2 +- .../{geo => }/BaseGeoPointFieldMapper.java | 15 +- .../mapper/{core => }/BinaryFieldMapper.java | 10 +- .../mapper/{core => }/BooleanFieldMapper.java | 10 +- .../{core => }/CompletionFieldMapper.java | 11 +- .../{core => }/CompletionFieldMapper2x.java | 11 +- .../index/mapper/CustomDocValuesField.java | 2 +- .../mapper/{core => }/DateFieldMapper.java | 12 +- .../index/mapper/DocumentMapper.java | 12 - .../index/mapper/DocumentMapperParser.java | 1 - .../index/mapper/DocumentParser.java | 21 +- .../mapper/{object => }/DynamicTemplate.java | 8 +- .../EnabledAttributeMapper.java | 2 +- .../index/mapper/FieldMapper.java | 2 - .../{internal => }/FieldNamesFieldMapper.java | 8 +- .../mapper/{geo => }/GeoPointFieldMapper.java | 8 +- .../{geo => }/GeoPointFieldMapperLegacy.java | 9 +- .../mapper/{geo => }/GeoShapeFieldMapper.java | 7 +- .../mapper/{internal => }/IdFieldMapper.java | 9 +- .../{internal => }/IndexFieldMapper.java | 7 +- .../index/mapper/{ip => }/IpFieldMapper.java | 11 +- .../mapper/{core => }/KeywordFieldMapper.java | 11 +- .../{core => }/LegacyByteFieldMapper.java | 8 +- .../{core => }/LegacyDateFieldMapper.java | 12 +- .../{core => }/LegacyDoubleFieldMapper.java | 8 +- .../{core => }/LegacyFloatFieldMapper.java | 8 +- .../{core => }/LegacyIntegerFieldMapper.java | 8 +- .../mapper/{ip => }/LegacyIpFieldMapper.java | 13 +- .../{ip => }/LegacyIpIndexFieldData.java | 2 +- .../{core => }/LegacyLongFieldMapper.java | 8 +- .../{core => }/LegacyNumberFieldMapper.java | 9 +- .../{core => }/LegacyShortFieldMapper.java | 8 +- .../LegacyTokenCountFieldMapper.java | 11 +- .../index/mapper/MapperService.java | 1 - .../index/mapper/MapperUtils.java | 5 +- .../elasticsearch/index/mapper/Mapping.java | 1 - .../index/mapper/MetadataFieldMapper.java | 1 - .../mapper/{core => }/NumberFieldMapper.java | 10 +- .../mapper/{object => }/ObjectMapper.java | 9 +- .../{internal => }/ParentFieldMapper.java | 10 +- .../index/mapper/ParseContext.java | 3 +- .../mapper/{object => }/RootObjectMapper.java | 12 +- .../{internal => }/RoutingFieldMapper.java | 8 +- .../{core => }/ScaledFloatFieldMapper.java | 11 +- .../{internal => }/SourceFieldMapper.java | 7 +- .../mapper/{core => }/StringFieldMapper.java | 11 +- .../mapper/{internal => }/TTLFieldMapper.java | 9 +- .../index/mapper/TermBasedFieldType.java | 2 +- .../mapper/{core => }/TextFieldMapper.java | 12 +- .../{internal => }/TimestampFieldMapper.java | 11 +- .../{core => }/TokenCountFieldMapper.java | 9 +- .../{internal => }/TypeFieldMapper.java | 9 +- .../index/mapper/{core => }/TypeParsers.java | 7 +- .../mapper/{internal => }/UidFieldMapper.java | 10 +- .../{internal => }/VersionFieldMapper.java | 7 +- .../index/query/ExistsQueryBuilder.java | 2 +- .../query/GeoBoundingBoxQueryBuilder.java | 4 +- .../index/query/GeoDistanceQueryBuilder.java | 6 +- .../query/GeoDistanceRangeQueryBuilder.java | 6 +- .../index/query/GeoPolygonQueryBuilder.java | 2 +- .../index/query/GeoShapeQueryBuilder.java | 2 +- .../index/query/GeohashCellQuery.java | 2 +- .../index/query/HasChildQueryBuilder.java | 2 +- .../index/query/HasParentQueryBuilder.java | 2 +- .../index/query/IdsQueryBuilder.java | 2 +- .../index/query/InnerHitBuilder.java | 2 +- .../index/query/MoreLikeThisQueryBuilder.java | 8 +- .../index/query/NestedQueryBuilder.java | 2 +- .../index/query/ParentIdQueryBuilder.java | 4 +- .../index/query/QueryShardContext.java | 4 +- .../index/query/RangeQueryBuilder.java | 4 +- .../functionscore/DecayFunctionBuilder.java | 10 +- .../index/query/support/NestedScope.java | 2 +- .../search/geo/GeoDistanceRangeQuery.java | 2 +- .../geo/IndexedGeoBoundingBoxQuery.java | 2 +- .../index/termvectors/TermVectorsService.java | 8 +- .../elasticsearch/indices/IndicesModule.java | 52 +-- .../indices/ttl/IndicesTTLService.java | 4 +- .../elasticsearch/ingest/IngestDocument.java | 16 +- .../children/ChildrenAggregationBuilder.java | 2 +- .../nested/NestedAggregationBuilder.java | 2 +- .../bucket/nested/NestedAggregator.java | 2 +- .../nested/NestedAggregatorFactory.java | 2 +- .../ReverseNestedAggregationBuilder.java | 2 +- .../nested/ReverseNestedAggregator.java | 2 +- .../ReverseNestedAggregatorFactory.java | 2 +- .../aggregations/support/ValueType.java | 2 +- .../search/fetch/FetchPhase.java | 4 +- .../fetch/innerhits/InnerHitsContext.java | 6 +- .../parent/ParentFieldSubFetchPhase.java | 2 +- .../fetch/version/VersionFetchSubPhase.java | 2 +- .../search/highlight/HighlightPhase.java | 8 +- .../search/internal/DefaultSearchContext.java | 4 +- .../internal/FilteredSearchContext.java | 2 +- .../search/internal/SearchContext.java | 2 +- .../search/slice/SliceBuilder.java | 2 +- .../search/sort/SortBuilder.java | 2 +- .../completion/CompletionSuggester.java | 2 +- .../CompletionSuggestionBuilder.java | 4 +- .../CompletionSuggestionContext.java | 4 +- .../completion/context/ContextMapping.java | 2 +- .../completion/context/ContextMappings.java | 2 +- .../completion/context/GeoContextMapping.java | 2 +- .../AnalyzingCompletionLookupProvider.java | 2 +- .../Completion090PostingsFormat.java | 2 +- .../completion2x/context/ContextBuilder.java | 1 + .../context/GeolocationContextMapping.java | 2 +- .../indices/TransportAnalyzeActionTests.java | 2 +- .../termvectors/TermVectorsUnitTests.java | 4 +- .../BasicBackwardsCompatibilityIT.java | 2 +- .../OldIndexBackwardsCompatibilityIT.java | 2 +- .../common/lucene/uid/VersionLookupTests.java | 4 +- .../common/lucene/uid/VersionsTests.java | 4 +- .../deps/joda/SimpleJodaTests.java | 2 +- .../explain/ExplainActionIT.java | 2 +- .../fieldstats/FieldStatsTests.java | 2 +- .../org/elasticsearch/get/GetActionIT.java | 2 +- .../index/engine/InternalEngineTests.java | 6 +- .../index/engine/ShadowEngineTests.java | 4 +- .../fielddata/AbstractFieldDataTestCase.java | 22 +- .../index/fielddata/FieldDataCacheTests.java | 2 +- .../index/fielddata/FilterFieldDataTests.java | 2 +- .../fielddata/IndexFieldDataServiceTests.java | 20 +- .../fielddata/ParentChildFieldDataTests.java | 4 +- .../plain/HalfFloatFielddataTests.java | 2 +- ...lFieldMapperPositionIncrementGapTests.java | 2 +- ...perTests.java => AllFieldMapperTests.java} | 6 +- .../{internal => }/AllFieldTypeTests.java | 4 +- ...Tests.java => BinaryFieldMapperTests.java} | 6 +- .../{core => }/BinaryFieldTypeTests.java | 4 +- .../{core => }/BooleanFieldMapperTests.java | 15 +- .../{core => }/BooleanFieldTypeTests.java | 4 +- .../CamelCaseFieldNameTests.java | 2 +- .../CompletionFieldMapper2xTests.java | 4 +- .../CompletionFieldMapperTests.java | 4 +- .../{core => }/CompletionFieldTypeTests.java | 4 +- .../{compound => }/CompoundTypesTests.java | 2 +- .../CopyToMapperIntegrationIT.java | 2 +- .../{copyto => }/CopyToMapperTests.java | 6 +- .../{boost => }/CustomBoostMappingTests.java | 2 +- .../{core => }/DateFieldMapperTests.java | 2 +- .../mapper/{core => }/DateFieldTypeTests.java | 7 +- ...sts.java => DocumentMapperMergeTests.java} | 6 +- ...ts.java => DocumentMapperParserTests.java} | 4 +- .../index/mapper/DocumentParserTests.java | 297 +++++++++++++++++- .../{lucene => }/DoubleIndexingDocTests.java | 2 +- .../index/mapper/DynamicMappingTests.java | 11 +- .../index/mapper/DynamicTemplateTests.java | 3 +- ...sTests.java => DynamicTemplatesTests.java} | 4 +- ...sts.java => ExternalFieldMapperTests.java} | 8 +- .../{externalvalues => }/ExternalMapper.java | 18 +- .../ExternalMapperPlugin.java | 2 +- .../ExternalMetadataMapper.java | 4 +- .../ExternalValuesMapperIntegrationIT.java | 2 +- .../FakeStringFieldMapper.java | 6 +- .../{boost => }/FieldLevelBoostTests.java | 2 +- .../FieldNamesFieldMapperTests.java | 3 +- .../FieldNamesFieldTypeTests.java | 4 +- .../GenericStoreDynamicTemplateTests.java | 2 +- .../mapper/{geo => }/GeoEncodingTests.java | 3 +- .../{geo => }/GeoPointFieldMapperTests.java | 2 +- .../{geo => }/GeoPointFieldTypeTests.java | 8 +- .../{geo => }/GeoShapeFieldMapperTests.java | 3 +- .../{geo => }/GeoShapeFieldTypeTests.java | 4 +- .../GeohashMappingGeoPointTests.java | 3 +- ...pingTests.java => IdFieldMapperTests.java} | 8 +- .../{internal => }/IdFieldTypeTests.java | 4 +- ...rTests.java => IndexFieldMapperTests.java} | 4 +- .../{internal => }/IndexFieldTypeTests.java | 4 +- .../mapper/{ip => }/IpFieldMapperTests.java | 3 +- .../mapper/{ip => }/IpFieldTypeTests.java | 4 +- .../merge => }/JavaMultiFieldMergeTests.java | 2 +- .../{core => }/KeywordFieldMapperTests.java | 2 +- .../{core => }/KeywordFieldTypeTests.java | 6 +- .../{core => }/LegacyByteFieldTypeTests.java | 4 +- ...s.java => LegacyDateFieldMapperTests.java} | 12 +- .../{core => }/LegacyDateFieldTypeTests.java | 6 +- .../LegacyDoubleFieldTypeTests.java | 6 +- .../{core => }/LegacyFloatFieldTypeTests.java | 6 +- .../LegacyIntegerFieldTypeTests.java | 6 +- ...sts.java => LegacyIpFieldMapperTests.java} | 5 +- .../{core => }/LegacyLongFieldTypeTests.java | 6 +- ...java => LegacyNumberFieldMapperTests.java} | 25 +- .../{core => }/LegacyShortFieldTypeTests.java | 4 +- ...sts.java => LegacyStringMappingTests.java} | 10 +- .../LegacyTokenCountFieldMapperTests.java | 3 +- .../index/mapper/MapperServiceTests.java | 4 +- .../MultiFieldCopyToMapperTests.java | 2 +- .../{multifield => }/MultiFieldTests.java | 12 +- .../MultiFieldsIntegrationIT.java | 2 +- ...ests.java => NestedObjectMapperTests.java} | 10 +- .../NullValueObjectMappingTests.java | 2 +- .../{null_value => }/NullValueTests.java | 2 +- .../{core => }/NumberFieldMapperTests.java | 2 +- .../{core => }/NumberFieldTypeTests.java | 6 +- ...ppingTests.java => ObjectMapperTests.java} | 4 +- ...Tests.java => ParentFieldMapperTests.java} | 50 ++- .../{internal => }/ParentFieldTypeTests.java | 4 +- .../mapper/{path => }/PathMapperTests.java | 2 +- .../PathMatchDynamicTemplateTests.java | 2 +- ...ests.java => RoutingFieldMapperTests.java} | 4 +- .../{internal => }/RoutingFieldTypeTests.java | 4 +- .../ScaledFloatFieldMapperTests.java | 2 +- .../{core => }/ScaledFloatFieldTypeTests.java | 5 +- ...Tests.java => SourceFieldMapperTests.java} | 4 +- .../{internal => }/SourceFieldTypeTests.java | 4 +- .../StoredNumericValuesTests.java | 2 +- ...gFieldMapperPositionIncrementGapTests.java | 2 +- .../{core => }/StringFieldTypeTests.java | 5 +- .../{core => }/StringMappingUpgradeTests.java | 7 +- ...ingTests.java => TTLFieldMapperTests.java} | 6 +- .../{core => }/TextFieldMapperTests.java | 5 +- .../mapper/{core => }/TextFieldTypeTests.java | 4 +- ...ts.java => TimestampFieldMapperTests.java} | 6 +- .../TimestampFieldTypeTests.java | 6 +- .../TokenCountFieldMapperIntegrationIT.java | 2 +- .../TokenCountFieldMapperTests.java | 3 +- .../{internal => }/TypeFieldMapperTests.java | 3 +- .../{internal => }/TypeFieldTypeTests.java | 4 +- .../{internal => }/UidFieldTypeTests.java | 4 +- .../UpdateMappingOnClusterIT.java | 2 +- .../{update => }/UpdateMappingTests.java | 2 +- .../{internal => }/VersionFieldTypeTests.java | 4 +- .../internal/ParentFieldMapperTests.java | 72 ----- .../index/mapper/package-info.java | 39 +++ .../mapper/simple/SimpleMapperTests.java | 136 -------- .../ParseDocumentTypeLevelsTests.java | 230 -------------- .../query/GeohashCellQueryBuilderTests.java | 4 +- .../query/HasChildQueryBuilderTests.java | 4 +- .../query/ParentIdQueryBuilderTests.java | 2 +- .../index/query/QueryShardContextTests.java | 2 +- .../index/query/TypeQueryBuilderTests.java | 2 +- .../ESIndexLevelReplicationTestCase.java | 2 +- .../index/shard/IndexShardTests.java | 2 +- .../index/shard/RefreshListenersTests.java | 2 +- .../indices/IndicesModuleTests.java | 6 +- .../aggregations/bucket/DateHistogramIT.java | 2 +- .../bucket/DateHistogramOffsetIT.java | 2 +- .../aggregations/bucket/StringTermsIT.java | 2 +- .../bucket/nested/NestedAggregatorTests.java | 4 +- .../pipeline/DateDerivativeIT.java | 2 +- .../search/fields/SearchFieldsIT.java | 2 +- .../search/geo/GeoShapeIntegrationIT.java | 2 +- .../highlight/HighlightBuilderTests.java | 2 +- .../internal/DefaultSearchContextTests.java | 2 +- .../elasticsearch/search/query/ExistsIT.java | 2 +- .../rescore/QueryRescoreBuilderTests.java | 2 +- .../search/slice/SliceBuilderTests.java | 2 +- .../search/sort/AbstractSortTestCase.java | 6 +- .../sort/GeoDistanceSortBuilderTests.java | 2 +- .../suggest/CompletionSuggestSearch2xIT.java | 2 +- .../ExpressionScriptEngineService.java | 6 +- .../percolator/PercolateQueryBuilder.java | 4 +- .../percolator/PercolatorFieldMapper.java | 4 +- .../AbstractAsyncBulkIndexByScrollAction.java | 18 +- .../reindex/ClientScrollableHitSource.java | 8 +- .../index/reindex/TransportReindexAction.java | 4 +- .../reindex/TransportUpdateByQueryAction.java | 14 +- .../mapper/attachments/AttachmentMapper.java | 10 +- .../DateAttachmentMapperTests.java | 2 +- ...anguageDetectionAttachmentMapperTests.java | 4 +- .../MultifieldAttachmentMapperTests.java | 4 +- .../mapper/murmur3/Murmur3FieldMapper.java | 2 +- .../index/mapper/size/SizeFieldMapper.java | 6 +- .../index/mapper/size/SizeMappingTests.java | 4 +- .../elasticsearch/test/TestSearchContext.java | 2 +- 291 files changed, 1040 insertions(+), 1388 deletions(-) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/AllFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{object => }/ArrayValueMapperParser.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{geo => }/BaseGeoPointFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/BinaryFieldMapper.java (94%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/BooleanFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/CompletionFieldMapper.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/CompletionFieldMapper2x.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/DateFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{object => }/DynamicTemplate.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/EnabledAttributeMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/FieldNamesFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{geo => }/GeoPointFieldMapper.java (93%) rename core/src/main/java/org/elasticsearch/index/mapper/{geo => }/GeoPointFieldMapperLegacy.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{geo => }/GeoShapeFieldMapper.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/IdFieldMapper.java (92%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/IndexFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{ip => }/IpFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/KeywordFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyByteFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyDateFieldMapper.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyDoubleFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyFloatFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyIntegerFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{ip => }/LegacyIpFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{ip => }/LegacyIpIndexFieldData.java (99%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyLongFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyNumberFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyShortFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/LegacyTokenCountFieldMapper.java (94%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/NumberFieldMapper.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{object => }/ObjectMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/ParentFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{object => }/RootObjectMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/RoutingFieldMapper.java (94%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/ScaledFloatFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/SourceFieldMapper.java (97%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/StringFieldMapper.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/TTLFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/TextFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/TimestampFieldMapper.java (96%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/TokenCountFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/TypeFieldMapper.java (95%) rename core/src/main/java/org/elasticsearch/index/mapper/{core => }/TypeParsers.java (98%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/UidFieldMapper.java (91%) rename core/src/main/java/org/elasticsearch/index/mapper/{internal => }/VersionFieldMapper.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{all => }/AllFieldMapperPositionIncrementGapTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{all/SimpleAllMapperTests.java => AllFieldMapperTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/AllFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{binary/BinaryMappingTests.java => BinaryFieldMapperTests.java} (95%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/BinaryFieldTypeTests.java (91%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/BooleanFieldMapperTests.java (95%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/BooleanFieldTypeTests.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{camelcase => }/CamelCaseFieldNameTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{completion => }/CompletionFieldMapper2xTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{completion => }/CompletionFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/CompletionFieldTypeTests.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{compound => }/CompoundTypesTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{copyto => }/CopyToMapperIntegrationIT.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{copyto => }/CopyToMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{boost => }/CustomBoostMappingTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/DateFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/DateFieldTypeTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{merge/TestMergeMapperTests.java => DocumentMapperMergeTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{typelevels/ParseMappingTypeLevelTests.java => DocumentMapperParserTests.java} (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{lucene => }/DoubleIndexingDocTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{dynamictemplate/simple/SimpleDynamicTemplatesTests.java => DynamicTemplatesTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues/SimpleExternalMappingTests.java => ExternalFieldMapperTests.java} (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues => }/ExternalMapper.java (94%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues => }/ExternalMapperPlugin.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues => }/ExternalMetadataMapper.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues => }/ExternalValuesMapperIntegrationIT.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{externalvalues => }/FakeStringFieldMapper.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{boost => }/FieldLevelBoostTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/FieldNamesFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/FieldNamesFieldTypeTests.java (95%) rename core/src/test/java/org/elasticsearch/index/mapper/{dynamictemplate/genericstore => }/GenericStoreDynamicTemplateTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeoEncodingTests.java (95%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeoPointFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeoPointFieldTypeTests.java (88%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeoShapeFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeoShapeFieldTypeTests.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{geo => }/GeohashMappingGeoPointTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{id/IdMappingTests.java => IdFieldMapperTests.java} (92%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/IdFieldTypeTests.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{index/IndexTypeMapperTests.java => IndexFieldMapperTests.java} (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/IndexFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{ip => }/IpFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{ip => }/IpFieldTypeTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{multifield/merge => }/JavaMultiFieldMergeTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/KeywordFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/KeywordFieldTypeTests.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyByteFieldTypeTests.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{date/LegacyDateMappingTests.java => LegacyDateFieldMapperTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyDateFieldTypeTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyDoubleFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyFloatFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyIntegerFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{ip/LegacyIpMappingTests.java => LegacyIpFieldMapperTests.java} (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyLongFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{numeric/LegacyNumericTests.java => LegacyNumberFieldMapperTests.java} (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyShortFieldTypeTests.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{string/SimpleStringMappingTests.java => LegacyStringMappingTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/LegacyTokenCountFieldMapperTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/MultiFieldCopyToMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{multifield => }/MultiFieldTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{multifield => }/MultiFieldsIntegrationIT.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{nested/NestedMappingTests.java => NestedObjectMapperTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{object => }/NullValueObjectMappingTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{null_value => }/NullValueTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/NumberFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/NumberFieldTypeTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{object/SimpleObjectMappingTests.java => ObjectMapperTests.java} (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{parent/ParentMappingTests.java => ParentFieldMapperTests.java} (72%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/ParentFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{path => }/PathMapperTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{dynamictemplate/pathmatch => }/PathMatchDynamicTemplateTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{routing/RoutingTypeMapperTests.java => RoutingFieldMapperTests.java} (95%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/RoutingFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/ScaledFloatFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/ScaledFloatFieldTypeTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{source/DefaultSourceMappingTests.java => SourceFieldMapperTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/SourceFieldTypeTests.java (90%) rename core/src/test/java/org/elasticsearch/index/mapper/{lucene => }/StoredNumericValuesTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{string => }/StringFieldMapperPositionIncrementGapTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/StringFieldTypeTests.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/StringMappingUpgradeTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{ttl/TTLMappingTests.java => TTLFieldMapperTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/TextFieldMapperTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/TextFieldTypeTests.java (98%) rename core/src/test/java/org/elasticsearch/index/mapper/{timestamp/TimestampMappingTests.java => TimestampFieldMapperTests.java} (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/TimestampFieldTypeTests.java (88%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/TokenCountFieldMapperIntegrationIT.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{core => }/TokenCountFieldMapperTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/TypeFieldMapperTests.java (96%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/TypeFieldTypeTests.java (97%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/UidFieldTypeTests.java (93%) rename core/src/test/java/org/elasticsearch/index/mapper/{update => }/UpdateMappingOnClusterIT.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{update => }/UpdateMappingTests.java (99%) rename core/src/test/java/org/elasticsearch/index/mapper/{internal => }/VersionFieldTypeTests.java (90%) delete mode 100644 core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldMapperTests.java create mode 100644 core/src/test/java/org/elasticsearch/index/mapper/package-info.java delete mode 100644 core/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java delete mode 100644 core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java diff --git a/buildSrc/src/main/resources/checkstyle_suppressions.xml b/buildSrc/src/main/resources/checkstyle_suppressions.xml index 75b3ecd240b..79ac64c3795 100644 --- a/buildSrc/src/main/resources/checkstyle_suppressions.xml +++ b/buildSrc/src/main/resources/checkstyle_suppressions.xml @@ -389,32 +389,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -816,51 +816,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java index 72222d56702..9bbe08208d7 100644 --- a/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java +++ b/core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java @@ -38,10 +38,10 @@ import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.automaton.RegExp; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.unit.Fuzziness; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.support.QueryParsers; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java b/core/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java index 8ec6a434b0c..fce3b0a40e5 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/analyze/TransportAnalyzeAction.java @@ -51,8 +51,8 @@ import org.elasticsearch.index.analysis.CustomAnalyzer; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.analysis.TokenFilterFactory; import org.elasticsearch.index.analysis.TokenizerFactory; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.analysis.AnalysisModule; diff --git a/core/src/main/java/org/elasticsearch/action/explain/TransportExplainAction.java b/core/src/main/java/org/elasticsearch/action/explain/TransportExplainAction.java index dc49f2f7ad6..95177853d41 100644 --- a/core/src/main/java/org/elasticsearch/action/explain/TransportExplainAction.java +++ b/core/src/main/java/org/elasticsearch/action/explain/TransportExplainAction.java @@ -37,7 +37,7 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; diff --git a/core/src/main/java/org/elasticsearch/action/index/IndexRequest.java b/core/src/main/java/org/elasticsearch/action/index/IndexRequest.java index a79f6d83204..63ede68b9fe 100644 --- a/core/src/main/java/org/elasticsearch/action/index/IndexRequest.java +++ b/core/src/main/java/org/elasticsearch/action/index/IndexRequest.java @@ -41,7 +41,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java b/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java index 919a3cb90b4..ed7f0d76ab3 100644 --- a/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java +++ b/core/src/main/java/org/elasticsearch/action/update/UpdateHelper.java @@ -38,10 +38,10 @@ import org.elasticsearch.index.engine.DocumentMissingException; import org.elasticsearch.index.engine.DocumentSourceMissingException; import org.elasticsearch.index.get.GetField; import org.elasticsearch.index.get.GetResult; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.script.ExecutableScript; diff --git a/core/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java b/core/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java index 78206cd1182..0798dff1c93 100644 --- a/core/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java +++ b/core/src/main/java/org/elasticsearch/cluster/metadata/MappingMetaData.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import java.io.IOException; import java.util.Map; diff --git a/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java b/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java index 929307dd4f7..b81720057c6 100644 --- a/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java +++ b/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java @@ -26,8 +26,7 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; - +import org.elasticsearch.index.mapper.GeoPointFieldMapper; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java b/core/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java index adb4de83c8f..84d02eb4ec7 100644 --- a/core/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java +++ b/core/src/main/java/org/elasticsearch/common/geo/builders/ShapeBuilder.java @@ -39,7 +39,7 @@ import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/common/lucene/search/Queries.java b/core/src/main/java/org/elasticsearch/common/lucene/search/Queries.java index c3144a7e372..2a3fd94e914 100644 --- a/core/src/main/java/org/elasticsearch/common/lucene/search/Queries.java +++ b/core/src/main/java/org/elasticsearch/common/lucene/search/Queries.java @@ -29,7 +29,7 @@ import org.apache.lucene.search.PrefixQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Nullable; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import java.util.List; import java.util.regex.Pattern; diff --git a/core/src/main/java/org/elasticsearch/common/lucene/uid/PerThreadIDAndVersionLookup.java b/core/src/main/java/org/elasticsearch/common/lucene/uid/PerThreadIDAndVersionLookup.java index 3a87fbb523b..67f06c4f8d0 100644 --- a/core/src/main/java/org/elasticsearch/common/lucene/uid/PerThreadIDAndVersionLookup.java +++ b/core/src/main/java/org/elasticsearch/common/lucene/uid/PerThreadIDAndVersionLookup.java @@ -30,8 +30,8 @@ import org.apache.lucene.search.DocIdSetIterator; import org.apache.lucene.util.Bits; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.lucene.uid.Versions.DocIdAndVersion; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java b/core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java index 3da8d800d8a..72dc9c89373 100644 --- a/core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java +++ b/core/src/main/java/org/elasticsearch/common/lucene/uid/Versions.java @@ -26,7 +26,7 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.Term; import org.apache.lucene.util.CloseableThreadLocal; import org.elasticsearch.common.util.concurrent.ConcurrentCollections; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import java.io.IOException; import java.util.List; diff --git a/core/src/main/java/org/elasticsearch/index/IndexSettings.java b/core/src/main/java/org/elasticsearch/index/IndexSettings.java index bbbe3b80cd3..dd0551aa5b6 100644 --- a/core/src/main/java/org/elasticsearch/index/IndexSettings.java +++ b/core/src/main/java/org/elasticsearch/index/IndexSettings.java @@ -32,7 +32,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.index.translog.Translog; import org.elasticsearch.node.Node; diff --git a/core/src/main/java/org/elasticsearch/index/analysis/AnalysisService.java b/core/src/main/java/org/elasticsearch/index/analysis/AnalysisService.java index afe5c2ff250..8d8d8f8c73a 100644 --- a/core/src/main/java/org/elasticsearch/index/analysis/AnalysisService.java +++ b/core/src/main/java/org/elasticsearch/index/analysis/AnalysisService.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.AbstractIndexComponent; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import java.io.Closeable; import java.util.Arrays; diff --git a/core/src/main/java/org/elasticsearch/index/analysis/CustomAnalyzerProvider.java b/core/src/main/java/org/elasticsearch/index/analysis/CustomAnalyzerProvider.java index a8bfd996a3e..144cbe81743 100644 --- a/core/src/main/java/org/elasticsearch/index/analysis/CustomAnalyzerProvider.java +++ b/core/src/main/java/org/elasticsearch/index/analysis/CustomAnalyzerProvider.java @@ -22,7 +22,7 @@ package org.elasticsearch.index.analysis; import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import java.util.ArrayList; import java.util.List; diff --git a/core/src/main/java/org/elasticsearch/index/cache/bitset/BitsetFilterCache.java b/core/src/main/java/org/elasticsearch/index/cache/bitset/BitsetFilterCache.java index 5eb2ec8ab70..cc3a90c4abc 100644 --- a/core/src/main/java/org/elasticsearch/index/cache/bitset/BitsetFilterCache.java +++ b/core/src/main/java/org/elasticsearch/index/cache/bitset/BitsetFilterCache.java @@ -47,7 +47,7 @@ import org.elasticsearch.index.IndexWarmer.TerminationHandle; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardUtils; diff --git a/core/src/main/java/org/elasticsearch/index/codec/PerFieldMappingPostingFormatCodec.java b/core/src/main/java/org/elasticsearch/index/codec/PerFieldMappingPostingFormatCodec.java index f0fb05f0995..e16e66904c9 100644 --- a/core/src/main/java/org/elasticsearch/index/codec/PerFieldMappingPostingFormatCodec.java +++ b/core/src/main/java/org/elasticsearch/index/codec/PerFieldMappingPostingFormatCodec.java @@ -25,10 +25,10 @@ import org.apache.lucene.codecs.lucene50.Lucene50StoredFieldsFormat; import org.apache.lucene.codecs.lucene60.Lucene60Codec; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.lucene.Lucene; +import org.elasticsearch.index.mapper.CompletionFieldMapper; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; /** * {@link PerFieldMappingPostingFormatCodec This postings format} is the default diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java index 111595859a9..83bdaf221b0 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/DocValuesIndexFieldData.java @@ -28,10 +28,10 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldDataCache; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; +import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.indices.breaker.CircuitBreakerService; import java.util.Map; diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java index 1410e742773..d57c023371e 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/IndexIndexFieldData.java @@ -33,7 +33,7 @@ import org.elasticsearch.index.fielddata.IndexFieldDataCache; import org.elasticsearch.index.fielddata.IndexOrdinalsFieldData; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.indices.breaker.CircuitBreakerService; import java.util.Collection; diff --git a/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java index 1fc82e31c60..d483baa777e 100644 --- a/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/fielddata/plain/ParentChildIndexFieldData.java @@ -48,7 +48,7 @@ import org.elasticsearch.index.fielddata.fieldcomparator.BytesRefFieldComparator import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.search.MultiValueMode; diff --git a/core/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java b/core/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java index f40b54ebb69..ee9634f690c 100644 --- a/core/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java +++ b/core/src/main/java/org/elasticsearch/index/fieldvisitor/FieldsVisitor.java @@ -25,13 +25,13 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/core/src/main/java/org/elasticsearch/index/fieldvisitor/JustUidFieldsVisitor.java b/core/src/main/java/org/elasticsearch/index/fieldvisitor/JustUidFieldsVisitor.java index 37690163995..2a6c362274a 100644 --- a/core/src/main/java/org/elasticsearch/index/fieldvisitor/JustUidFieldsVisitor.java +++ b/core/src/main/java/org/elasticsearch/index/fieldvisitor/JustUidFieldsVisitor.java @@ -19,7 +19,7 @@ package org.elasticsearch.index.fieldvisitor; import org.apache.lucene.index.FieldInfo; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/fieldvisitor/SingleFieldsVisitor.java b/core/src/main/java/org/elasticsearch/index/fieldvisitor/SingleFieldsVisitor.java index 1751a820d8c..2503286f710 100644 --- a/core/src/main/java/org/elasticsearch/index/fieldvisitor/SingleFieldsVisitor.java +++ b/core/src/main/java/org/elasticsearch/index/fieldvisitor/SingleFieldsVisitor.java @@ -19,10 +19,10 @@ package org.elasticsearch.index.fieldvisitor; import org.apache.lucene.index.FieldInfo; +import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import java.io.IOException; import java.util.List; diff --git a/core/src/main/java/org/elasticsearch/index/get/ShardGetService.java b/core/src/main/java/org/elasticsearch/index/get/ShardGetService.java index f6e593c2d82..dd9daad1824 100644 --- a/core/src/main/java/org/elasticsearch/index/get/ShardGetService.java +++ b/core/src/main/java/org/elasticsearch/index/get/ShardGetService.java @@ -40,13 +40,13 @@ import org.elasticsearch.index.fieldvisitor.FieldsVisitor; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.AbstractIndexShardComponent; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.translog.Translog; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/AllFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/AllFieldMapper.java index 02a2cb0c780..05d94ff919d 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/AllFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/AllFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -30,12 +30,6 @@ import org.elasticsearch.common.lucene.all.AllTermQuery; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.StringFieldType; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.similarity.SimilarityService; @@ -46,7 +40,7 @@ import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.lenientNodeBooleanValue; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeMapValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseTextField; +import static org.elasticsearch.index.mapper.TypeParsers.parseTextField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/object/ArrayValueMapperParser.java b/core/src/main/java/org/elasticsearch/index/mapper/ArrayValueMapperParser.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/object/ArrayValueMapperParser.java rename to core/src/main/java/org/elasticsearch/index/mapper/ArrayValueMapperParser.java index 2044466d710..44eeb917f31 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/object/ArrayValueMapperParser.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ArrayValueMapperParser.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; /** * A marker interface indicating that this mapper can handle array value, and the array diff --git a/core/src/main/java/org/elasticsearch/index/mapper/geo/BaseGeoPointFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/BaseGeoPointFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/geo/BaseGeoPointFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/BaseGeoPointFieldMapper.java index a767b808210..99dd39ef2e6 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/geo/BaseGeoPointFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/BaseGeoPointFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -39,17 +39,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.AbstractGeoPointDVIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.object.ArrayValueMapperParser; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; import org.elasticsearch.search.DocValueFormat; @@ -61,7 +50,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * GeoPointFieldMapper base class to maintain backward compatibility diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java similarity index 94% rename from core/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java index ff6d943b72a..cb6fae8b59d 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/BinaryFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/BinaryFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import com.carrotsearch.hppc.ObjectArrayList; import org.apache.lucene.document.Field; @@ -33,12 +33,6 @@ import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.BytesBinaryDVIndexFieldData; -import org.elasticsearch.index.mapper.CustomDocValuesField; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; @@ -47,7 +41,7 @@ import java.util.Base64; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java index 17e8712f571..b27f564f2d7 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/BooleanFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/BooleanFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedNumericDocValuesField; @@ -34,12 +34,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; import org.elasticsearch.search.DocValueFormat; import org.joda.time.DateTimeZone; @@ -49,7 +43,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.lenientNodeBooleanValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * A field mapper for boolean fields. diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java index 81f890d3e0e..13bb7d255a8 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.document.Field; @@ -39,13 +39,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.NumberType; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; -import org.elasticsearch.index.mapper.object.ArrayValueMapperParser; import org.elasticsearch.search.suggest.completion.CompletionSuggester; import org.elasticsearch.search.suggest.completion.context.ContextMapping; import org.elasticsearch.search.suggest.completion.context.ContextMappings; @@ -60,7 +53,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; +import static org.elasticsearch.index.mapper.TypeParsers.parseMultiField; /** * Mapper for completion field. The field values are indexed as a weighted FST for diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper2x.java b/core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper2x.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper2x.java rename to core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper2x.java index 6fffb0e6e23..655af43710f 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/CompletionFieldMapper2x.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/CompletionFieldMapper2x.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -34,13 +34,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.NumberType; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperException; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; import org.elasticsearch.search.suggest.completion2x.AnalyzingCompletionLookupProvider; import org.elasticsearch.search.suggest.completion2x.Completion090PostingsFormat; import org.elasticsearch.search.suggest.completion2x.CompletionTokenStream; @@ -60,7 +53,7 @@ import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; +import static org.elasticsearch.index.mapper.TypeParsers.parseMultiField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/CustomDocValuesField.java b/core/src/main/java/org/elasticsearch/index/mapper/CustomDocValuesField.java index 737c8ddaabf..a8b27d11245 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/CustomDocValuesField.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/CustomDocValuesField.java @@ -29,7 +29,7 @@ import org.apache.lucene.index.IndexableFieldType; import java.io.Reader; // used for binary and geo fields -public abstract class CustomDocValuesField implements IndexableField { +abstract class CustomDocValuesField implements IndexableField { public static final FieldType TYPE = new FieldType(); static { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java index 66cb7255fd6..f3d1fbd53f3 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/DateFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DateFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; @@ -43,13 +43,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper.Defaults; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.internal.SearchContext; @@ -63,7 +57,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.Callable; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseDateTimeFormatter; +import static org.elasticsearch.index.mapper.TypeParsers.parseDateTimeFormatter; /** A {@link FieldMapper} for ip addresses. */ public class DateFieldMapper extends FieldMapper implements AllFieldMapper.IncludeInAll { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java index 9201844e743..a4d1a0c5e4b 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapper.java @@ -34,18 +34,6 @@ import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.mapper.MetadataFieldMapper.TypeParser; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapperParser.java b/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapperParser.java index 3e14531501e..f336fbb01ac 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapperParser.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DocumentMapperParser.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisService; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.indices.mapper.MapperRegistry; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java b/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java index 697c8e9e4ef..80d59ec39f6 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DocumentParser.java @@ -28,23 +28,10 @@ import org.elasticsearch.common.joda.FormatDateTimeFormatter; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.object.ArrayValueMapperParser; -import org.elasticsearch.index.mapper.object.DynamicTemplate.XContentFieldType; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.DynamicTemplate.XContentFieldType; +import org.elasticsearch.index.mapper.KeywordFieldMapper.KeywordFieldType; +import org.elasticsearch.index.mapper.StringFieldMapper.StringFieldType; +import org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/object/DynamicTemplate.java b/core/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/object/DynamicTemplate.java rename to core/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java index 2cd8a6d7d3a..08620ed8c45 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/object/DynamicTemplate.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/DynamicTemplate.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.common.logging.DeprecationLogger; @@ -25,12 +25,6 @@ import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/EnabledAttributeMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/EnabledAttributeMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/EnabledAttributeMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/EnabledAttributeMapper.java index 5eda7d8aa42..f46de98f907 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/EnabledAttributeMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/EnabledAttributeMapper.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; public enum EnabledAttributeMapper { ENABLED(true), UNSET_ENABLED(true), DISABLED(false), UNSET_DISABLED(false); diff --git a/core/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java index f1126f35fb1..e3f88b2231a 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/FieldMapper.java @@ -32,8 +32,6 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.core.TypeParsers; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.index.similarity.SimilarityService; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java index 06dadf7c4e6..1b18652bce5 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/FieldNamesFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -26,12 +26,6 @@ import org.apache.lucene.search.Query; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java similarity index 93% rename from core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java index ad957ff66f9..c27ddc1811b 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.FieldType; import org.apache.lucene.index.DocValuesType; @@ -28,12 +28,6 @@ import org.elasticsearch.common.Explicit; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.GeoUtils; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; import java.io.IOException; import java.util.Map; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperLegacy.java b/core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapperLegacy.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperLegacy.java rename to core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapperLegacy.java index 4c2cab9f219..4d09e6f9833 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperLegacy.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapperLegacy.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import com.carrotsearch.hppc.ObjectHashSet; import com.carrotsearch.hppc.cursors.ObjectCursor; @@ -33,13 +33,6 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.util.ByteUtils; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.CustomDocValuesField; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.object.ArrayValueMapperParser; import java.io.IOException; import java.util.Iterator; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java index ac31c3a7243..9c90dd44dbc 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.locationtech.spatial4j.shape.Point; import org.locationtech.spatial4j.shape.Shape; @@ -42,11 +42,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java similarity index 92% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java index 67bacf93e86..d70a50eede9 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/IdFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/IdFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -36,13 +36,6 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.iterable.Iterables; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; -import org.elasticsearch.index.mapper.Uid; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java index f56b04c92aa..e1615add19e 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/IndexFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/IndexFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -31,11 +31,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.IndexIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java index a123f64c4d6..c5e83657608 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/ip/IpFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.InetAddressPoint; @@ -38,14 +38,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults; -import org.elasticsearch.index.mapper.core.TypeParsers; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper.Defaults; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.DocValueFormat; import org.joda.time.DateTimeZone; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/KeywordFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/core/KeywordFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java index 5215f0ec8e6..1874c86ac77 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/KeywordFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; @@ -30,20 +30,13 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.StringFieldType; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * A field mapper for keywords. This mapper accepts strings and indexes them as-is. diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyByteFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyByteFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyByteFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyByteFieldMapper.java index ff7efe76c8a..a7f8f85f8f5 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyByteFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyByteFieldMapper.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -38,10 +38,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -49,7 +45,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeByteValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDateFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyDateFieldMapper.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDateFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyDateFieldMapper.java index a3374153955..58fbe2895dd 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDateFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyDateFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -43,11 +43,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper.CustomLongNumericField; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper.CustomLongNumericField; import org.elasticsearch.search.DocValueFormat; import org.elasticsearch.search.internal.SearchContext; import org.joda.time.DateTimeZone; @@ -61,8 +57,8 @@ import java.util.Objects; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseDateTimeFormatter; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseDateTimeFormatter; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; public class LegacyDateFieldMapper extends LegacyNumberFieldMapper { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyDoubleFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyDoubleFieldMapper.java index 9e407a63340..0e727161191 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyDoubleFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -41,10 +41,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -52,7 +48,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeDoubleValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyFloatFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyFloatFieldMapper.java index d65801275ea..831ac973dee 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyFloatFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -40,10 +40,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -51,7 +47,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeFloatValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIntegerFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyIntegerFieldMapper.java index f0ada9d6622..6a840813abe 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIntegerFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -39,10 +39,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -50,7 +46,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeIntegerValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIpFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyIpFieldMapper.java index f1812c93735..4c76e3ec82a 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIpFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -40,14 +40,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexFieldDataCache; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper.CustomLongNumericField; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper.CustomLongNumericField; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.search.DocValueFormat; @@ -60,7 +53,7 @@ import java.util.List; import java.util.Map; import java.util.regex.Pattern; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpIndexFieldData.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIpIndexFieldData.java similarity index 99% rename from core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpIndexFieldData.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyIpIndexFieldData.java index 8435f639b7f..ffad4deeb59 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/ip/LegacyIpIndexFieldData.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyIpIndexFieldData.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import java.io.IOException; import java.net.InetAddress; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyLongFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyLongFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyLongFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyLongFieldMapper.java index f53bb42fb90..b1e156e263e 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyLongFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyLongFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -39,10 +39,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -50,7 +46,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeLongValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyNumberFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyNumberFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapper.java index 2b0cf0968ad..b1d3ead8464 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyNumberFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import java.io.IOException; import java.io.Reader; @@ -34,13 +34,6 @@ import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.search.DocValueFormat; import org.joda.time.DateTimeZone; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyShortFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyShortFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyShortFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyShortFieldMapper.java index 2c07714f452..39e00801789 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyShortFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyShortFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -40,10 +40,6 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -51,7 +47,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeShortValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapper.java similarity index 94% rename from core/src/main/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapper.java index 8f7bda4e9ab..48244ffb377 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -28,12 +28,7 @@ import org.elasticsearch.common.Explicit; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.StringFieldMapper.ValueAndBoost; +import org.elasticsearch.index.mapper.StringFieldMapper.ValueAndBoost; import java.io.IOException; import java.util.Iterator; @@ -42,7 +37,7 @@ import java.util.Map; import static org.apache.lucene.index.IndexOptions.NONE; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeIntegerValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; +import static org.elasticsearch.index.mapper.TypeParsers.parseNumberField; /** * A {@link FieldMapper} that takes a string and writes a count of the tokens in that string diff --git a/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java index 527518ecf43..43bf505da4c 100755 --- a/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -37,7 +37,6 @@ import org.elasticsearch.index.AbstractIndexComponent; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.mapper.Mapper.BuilderContext; -import org.elasticsearch.index.mapper.object.ObjectMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.indices.InvalidTypeNameException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java b/core/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java index 04508827f77..ad57d72b345 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/MapperUtils.java @@ -19,12 +19,9 @@ package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.object.RootObjectMapper; - import java.util.Collection; -public enum MapperUtils { +enum MapperUtils { ; /** Split mapper and its descendants into object and field mappers. */ diff --git a/core/src/main/java/org/elasticsearch/index/mapper/Mapping.java b/core/src/main/java/org/elasticsearch/index/mapper/Mapping.java index 8c451c93774..0b92dbe4517 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/Mapping.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/Mapping.java @@ -23,7 +23,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java index 3ec3991837f..07a4b3b9a51 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/MetadataFieldMapper.java @@ -20,7 +20,6 @@ package org.elasticsearch.index.mapper; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import java.io.IOException; import java.util.Map; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java index 91a008c14e9..6eddf07b979 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/NumberFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/NumberFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.DoublePoint; import org.apache.lucene.document.Field; @@ -47,13 +47,7 @@ import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper.Defaults; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.DocValueFormat; import org.joda.time.DateTimeZone; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java index 073319b0c7d..773cb1c4883 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/object/ObjectMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ObjectMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; @@ -30,13 +30,6 @@ import org.elasticsearch.common.collect.CopyOnWriteHashMap; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/ParentFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/ParentFieldMapper.java index 2ed719a9970..9caef2c7740 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/ParentFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ParentFieldMapper.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedDocValuesField; @@ -38,14 +38,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; -import org.elasticsearch.index.mapper.ContentPath; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java b/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java index 64be912733f..477f88cc53c 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ParseContext.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.lucene.all.AllEntries; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.analysis.AnalysisService; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import java.util.ArrayList; import java.util.Iterator; @@ -523,7 +522,7 @@ public abstract class ParseContext { } /** - * Is all included or not. Will always disable it if {@link org.elasticsearch.index.mapper.internal.AllFieldMapper#enabled()} + * Is all included or not. Will always disable it if {@link org.elasticsearch.index.mapper.AllFieldMapper#enabled()} * is false. If its enabled, then will return true only if the specific flag is null or * its actual value (so, if not set, defaults to "true") and the field is indexed. */ diff --git a/core/src/main/java/org/elasticsearch/index/mapper/object/RootObjectMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/object/RootObjectMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java index 31bb9afce5c..f419d525e1a 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/object/RootObjectMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/RootObjectMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.common.Nullable; @@ -26,13 +26,7 @@ import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.ContentPath; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.object.DynamicTemplate.XContentFieldType; +import org.elasticsearch.index.mapper.DynamicTemplate.XContentFieldType; import java.io.IOException; import java.util.ArrayList; @@ -44,7 +38,7 @@ import java.util.Map; import java.util.Set; import static org.elasticsearch.common.xcontent.support.XContentMapValues.lenientNodeBooleanValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseDateTimeFormatter; +import static org.elasticsearch.index.mapper.TypeParsers.parseDateTimeFormatter; /** * diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java similarity index 94% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java index 031732f4d11..aa3e78b8ee0 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/RoutingFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java @@ -17,19 +17,13 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; import java.io.IOException; import java.util.Iterator; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapper.java index ca4de2cc318..8c50e868020 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.DocValues; @@ -49,14 +49,7 @@ import org.elasticsearch.index.fielddata.SortedBinaryDocValues; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; import org.elasticsearch.index.fielddata.fieldcomparator.DoubleValuesComparatorSource; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper.Defaults; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper.Defaults; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.search.DocValueFormat; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java similarity index 97% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java index 0f5d0516842..4854eb57752 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/SourceFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/SourceFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.StoredField; @@ -36,11 +36,6 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.support.XContentMapValues; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/StringFieldMapper.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/StringFieldMapper.java index b0e0ba101a5..6f529c82ea1 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/StringFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/StringFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; @@ -40,13 +40,6 @@ import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; @@ -59,7 +52,7 @@ import java.util.Objects; import java.util.Set; import static org.apache.lucene.index.IndexOptions.NONE; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseTextField; +import static org.elasticsearch.index.mapper.TypeParsers.parseTextField; public class StringFieldMapper extends FieldMapper implements AllFieldMapper.IncludeInAll { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/TTLFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/TTLFieldMapper.java index ec1024c07f5..f95f42156e1 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/TTLFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TTLFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -28,13 +28,6 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.AlreadyExpiredException; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; import org.elasticsearch.search.internal.SearchContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/TermBasedFieldType.java b/core/src/main/java/org/elasticsearch/index/mapper/TermBasedFieldType.java index 4b346af6346..71d07aa385f 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/TermBasedFieldType.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TermBasedFieldType.java @@ -33,7 +33,7 @@ import org.elasticsearch.index.query.QueryShardContext; /** Base {@link MappedFieldType} implementation for a field that is indexed * with the inverted index. */ -public abstract class TermBasedFieldType extends MappedFieldType { +abstract class TermBasedFieldType extends MappedFieldType { public TermBasedFieldType() {} diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/TextFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/core/TextFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java index 2aada51360c..987586db721 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/TextFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TextFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -28,14 +28,6 @@ import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.StringFieldType; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import java.io.IOException; import java.util.Iterator; @@ -43,7 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseTextField; +import static org.elasticsearch.index.mapper.TypeParsers.parseTextField; /** A {@link FieldMapper} for full-text fields. */ public class TextFieldMapper extends FieldMapper implements AllFieldMapper.IncludeInAll { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/TimestampFieldMapper.java similarity index 96% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/TimestampFieldMapper.java index 6889cd90fd0..d57d2f89c6f 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/TimestampFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TimestampFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -29,13 +29,6 @@ import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; import java.io.IOException; import java.util.ArrayList; @@ -44,7 +37,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.lenientNodeBooleanValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseDateTimeFormatter; +import static org.elasticsearch.index.mapper.TypeParsers.parseDateTimeFormatter; public class TimestampFieldMapper extends MetadataFieldMapper { diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/TokenCountFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/TokenCountFieldMapper.java index 0cfa89c5537..daa36664f9d 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TokenCountFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.TokenStream; @@ -28,11 +28,6 @@ import org.elasticsearch.Version; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext; import java.io.IOException; import java.util.Iterator; @@ -40,7 +35,7 @@ import java.util.List; import java.util.Map; import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeIntegerValue; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * A {@link FieldMapper} that takes a string and writes a count of the tokens in that string diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java similarity index 95% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java index d882be8e9d7..0889fab6636 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/TypeFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TypeFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; @@ -38,13 +38,6 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.StringFieldType; -import org.elasticsearch.index.mapper.core.TextFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java b/core/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java similarity index 98% rename from core/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java rename to core/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java index 3ada93acccb..e388c8ea576 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/core/TypeParsers.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/TypeParsers.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.elasticsearch.ElasticsearchParseException; @@ -30,11 +30,6 @@ import org.elasticsearch.common.logging.ESLoggerFactory; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.analysis.NamedAnalyzer; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.object.ObjectMapper; import org.elasticsearch.index.similarity.SimilarityProvider; import org.elasticsearch.index.similarity.SimilarityService; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/UidFieldMapper.java similarity index 91% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/UidFieldMapper.java index e020864c7e8..f27fa30b91c 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/UidFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/UidFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Field; @@ -28,14 +28,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.TermBasedFieldType; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.Uid; import java.io.IOException; import java.util.List; diff --git a/core/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java b/core/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java similarity index 93% rename from core/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java rename to core/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java index 98a69702d2a..c66044bdb30 100644 --- a/core/src/main/java/org/elasticsearch/index/mapper/internal/VersionFieldMapper.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/VersionFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.NumericDocValuesField; @@ -25,11 +25,6 @@ import org.apache.lucene.index.DocValuesType; import org.apache.lucene.search.Query; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; diff --git a/core/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java index 086e450ed9f..93e491d6269 100644 --- a/core/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/ExistsQueryBuilder.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import java.io.IOException; import java.util.Collection; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java index 4e76e10e554..a884c5aea19 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoBoundingBoxQueryBuilder.java @@ -37,9 +37,9 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; import org.elasticsearch.index.search.geo.InMemoryGeoBoundingBoxQuery; import org.elasticsearch.index.search.geo.IndexedGeoBoundingBoxQuery; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java index fc92a490952..29b621e9536 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoDistanceQueryBuilder.java @@ -36,10 +36,10 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; import org.elasticsearch.index.search.geo.GeoDistanceRangeQuery; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeQueryBuilder.java index 3b76c6867da..d4142e12b33 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoDistanceRangeQueryBuilder.java @@ -36,10 +36,10 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; import org.elasticsearch.index.search.geo.GeoDistanceRangeQuery; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java index b9ebd345ad6..65ce33c1c98 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java @@ -35,8 +35,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; import org.elasticsearch.index.search.geo.GeoPolygonQuery; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java index b329f28b760..76e9bc0f9be 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java @@ -42,8 +42,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper; import java.io.IOException; import java.util.Objects; diff --git a/core/src/main/java/org/elasticsearch/index/query/GeohashCellQuery.java b/core/src/main/java/org/elasticsearch/index/query/GeohashCellQuery.java index a40fb7ad9fa..57a189b72f4 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeohashCellQuery.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeohashCellQuery.java @@ -35,8 +35,8 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/query/HasChildQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/HasChildQueryBuilder.java index 1301f15cc7d..81fe106833d 100644 --- a/core/src/main/java/org/elasticsearch/index/query/HasChildQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/HasChildQueryBuilder.java @@ -37,7 +37,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexParentChildFieldData; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import java.io.IOException; import java.util.Locale; diff --git a/core/src/main/java/org/elasticsearch/index/query/HasParentQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/HasParentQueryBuilder.java index 7f412c4f453..5b89262ecc7 100644 --- a/core/src/main/java/org/elasticsearch/index/query/HasParentQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/HasParentQueryBuilder.java @@ -32,7 +32,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import java.io.IOException; import java.util.HashSet; diff --git a/core/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java index bbc294b88b2..c8f9f55f96e 100644 --- a/core/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/IdsQueryBuilder.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java b/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java index 3dd7bd0bcc8..5416b554641 100644 --- a/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptContext; import org.elasticsearch.script.SearchScript; diff --git a/core/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java index 8ec0f377ca1..9fb1343b118 100644 --- a/core/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryBuilder.java @@ -53,10 +53,10 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.VersionType; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType; -import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType; -import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; +import org.elasticsearch.index.mapper.KeywordFieldMapper.KeywordFieldType; +import org.elasticsearch.index.mapper.StringFieldMapper.StringFieldType; +import org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java index e75c3728cbe..f3b0b7379dd 100644 --- a/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java @@ -31,7 +31,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import java.io.IOException; import java.util.Map; diff --git a/core/src/main/java/org/elasticsearch/index/query/ParentIdQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/ParentIdQueryBuilder.java index d4a0956a8ae..1b1a9508bc4 100644 --- a/core/src/main/java/org/elasticsearch/index/query/ParentIdQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/ParentIdQueryBuilder.java @@ -33,8 +33,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import java.io.IOException; import java.util.Objects; diff --git a/core/src/main/java/org/elasticsearch/index/query/QueryShardContext.java b/core/src/main/java/org/elasticsearch/index/query/QueryShardContext.java index 56a75a69138..78869f5374a 100644 --- a/core/src/main/java/org/elasticsearch/index/query/QueryShardContext.java +++ b/core/src/main/java/org/elasticsearch/index/query/QueryShardContext.java @@ -49,8 +49,8 @@ import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.indices.query.IndicesQueriesRegistry; diff --git a/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java index 8f52666fa8e..d19441e8cf7 100644 --- a/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/RangeQueryBuilder.java @@ -34,10 +34,10 @@ import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; import org.joda.time.DateTimeZone; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java b/core/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java index 7ddf11202df..c2d20587cf0 100644 --- a/core/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/functionscore/DecayFunctionBuilder.java @@ -42,12 +42,12 @@ import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.MultiGeoPointValues; import org.elasticsearch.index.fielddata.NumericDoubleValues; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.MultiValueMode; diff --git a/core/src/main/java/org/elasticsearch/index/query/support/NestedScope.java b/core/src/main/java/org/elasticsearch/index/query/support/NestedScope.java index 8a7383d4cc5..efc21940796 100644 --- a/core/src/main/java/org/elasticsearch/index/query/support/NestedScope.java +++ b/core/src/main/java/org/elasticsearch/index/query/support/NestedScope.java @@ -19,7 +19,7 @@ package org.elasticsearch.index.query.support; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import java.util.Deque; import java.util.LinkedList; diff --git a/core/src/main/java/org/elasticsearch/index/search/geo/GeoDistanceRangeQuery.java b/core/src/main/java/org/elasticsearch/index/search/geo/GeoDistanceRangeQuery.java index 6c4fd23e64c..ebef702dfd9 100644 --- a/core/src/main/java/org/elasticsearch/index/search/geo/GeoDistanceRangeQuery.java +++ b/core/src/main/java/org/elasticsearch/index/search/geo/GeoDistanceRangeQuery.java @@ -35,7 +35,7 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; import org.elasticsearch.index.fielddata.MultiGeoPointValues; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/index/search/geo/IndexedGeoBoundingBoxQuery.java b/core/src/main/java/org/elasticsearch/index/search/geo/IndexedGeoBoundingBoxQuery.java index 436fc80d521..5831f014c95 100644 --- a/core/src/main/java/org/elasticsearch/index/search/geo/IndexedGeoBoundingBoxQuery.java +++ b/core/src/main/java/org/elasticsearch/index/search/geo/IndexedGeoBoundingBoxQuery.java @@ -24,7 +24,7 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import org.elasticsearch.common.geo.GeoPoint; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; /** */ diff --git a/core/src/main/java/org/elasticsearch/index/termvectors/TermVectorsService.java b/core/src/main/java/org/elasticsearch/index/termvectors/TermVectorsService.java index fb013f5c31f..daaf01999bd 100644 --- a/core/src/main/java/org/elasticsearch/index/termvectors/TermVectorsService.java +++ b/core/src/main/java/org/elasticsearch/index/termvectors/TermVectorsService.java @@ -39,15 +39,15 @@ import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.get.GetField; import org.elasticsearch.index.get.GetResult; import org.elasticsearch.index.mapper.DocumentMapperForType; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.StringFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.search.dfs.AggregatedDfs; diff --git a/core/src/main/java/org/elasticsearch/indices/IndicesModule.java b/core/src/main/java/org/elasticsearch/indices/IndicesModule.java index 35e3d989b5d..d45725ff4ef 100644 --- a/core/src/main/java/org/elasticsearch/indices/IndicesModule.java +++ b/core/src/main/java/org/elasticsearch/indices/IndicesModule.java @@ -29,34 +29,34 @@ import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry; import org.elasticsearch.index.NodeServicesProvider; +import org.elasticsearch.index.mapper.AllFieldMapper; +import org.elasticsearch.index.mapper.BinaryFieldMapper; +import org.elasticsearch.index.mapper.BooleanFieldMapper; +import org.elasticsearch.index.mapper.CompletionFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; +import org.elasticsearch.index.mapper.IndexFieldMapper; +import org.elasticsearch.index.mapper.IpFieldMapper; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.core.TokenCountFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.ScaledFloatFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; -import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; -import org.elasticsearch.index.mapper.ip.IpFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.NumberFieldMapper; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.ScaledFloatFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.StringFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TokenCountFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.indices.cluster.IndicesClusterStateService; import org.elasticsearch.indices.flush.SyncedFlushService; import org.elasticsearch.indices.mapper.MapperRegistry; diff --git a/core/src/main/java/org/elasticsearch/indices/ttl/IndicesTTLService.java b/core/src/main/java/org/elasticsearch/indices/ttl/IndicesTTLService.java index a752c226429..fd50e1f8f30 100644 --- a/core/src/main/java/org/elasticsearch/indices/ttl/IndicesTTLService.java +++ b/core/src/main/java/org/elasticsearch/indices/ttl/IndicesTTLService.java @@ -46,9 +46,9 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.fieldvisitor.FieldsVisitor; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.IndexShardState; import org.elasticsearch.indices.IndicesService; diff --git a/core/src/main/java/org/elasticsearch/ingest/IngestDocument.java b/core/src/main/java/org/elasticsearch/ingest/IngestDocument.java index 86eaf7d179f..f61abdd48d5 100644 --- a/core/src/main/java/org/elasticsearch/ingest/IngestDocument.java +++ b/core/src/main/java/org/elasticsearch/ingest/IngestDocument.java @@ -20,14 +20,14 @@ package org.elasticsearch.ingest; import org.elasticsearch.common.Strings; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; +import org.elasticsearch.index.mapper.IndexFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregationBuilder.java index 3bd26ea70fc..5e4b2e2aa79 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/children/ChildrenAggregationBuilder.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.search.aggregations.AggregatorFactories.Builder; import org.elasticsearch.search.aggregations.InternalAggregation.Type; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java index 98c5f02af05..e3dd04b62fb 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregationBuilder.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.search.aggregations.AbstractAggregationBuilder; import org.elasticsearch.search.aggregations.AggregationExecutionException; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java index 7716810a1b3..448ea44e7eb 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregator.java @@ -30,7 +30,7 @@ import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.util.BitSet; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.InternalAggregation; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java index ef19a186d52..b4e9fa05f70 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorFactory.java @@ -19,7 +19,7 @@ package org.elasticsearch.search.aggregations.bucket.nested; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java index 52ff64f2903..999ad0fc32f 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregationBuilder.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.support.NestedScope; import org.elasticsearch.search.SearchParseException; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java index a60d939b102..d45f103ed5e 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregator.java @@ -26,7 +26,7 @@ import org.apache.lucene.search.join.BitSetProducer; import org.apache.lucene.util.BitSet; import org.elasticsearch.common.ParseField; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; import org.elasticsearch.search.aggregations.InternalAggregation; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java index d626c1b5441..b077e755bb7 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ReverseNestedAggregatorFactory.java @@ -19,7 +19,7 @@ package org.elasticsearch.search.aggregations.bucket.nested; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.search.SearchParseException; import org.elasticsearch.search.aggregations.AggregationExecutionException; import org.elasticsearch.search.aggregations.Aggregator; diff --git a/core/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java b/core/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java index 51f336a3422..9e0bf350beb 100644 --- a/core/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java +++ b/core/src/main/java/org/elasticsearch/search/aggregations/support/ValueType.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexGeoPointFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; -import org.elasticsearch.index.mapper.core.DateFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.search.DocValueFormat; import org.joda.time.DateTimeZone; diff --git a/core/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java b/core/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java index beb64120788..81da15e087c 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java @@ -39,8 +39,8 @@ import org.elasticsearch.index.fieldvisitor.CustomFieldsVisitor; import org.elasticsearch.index.fieldvisitor.FieldsVisitor; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHitField; import org.elasticsearch.search.SearchParseElement; diff --git a/core/src/main/java/org/elasticsearch/search/fetch/innerhits/InnerHitsContext.java b/core/src/main/java/org/elasticsearch/search/fetch/innerhits/InnerHitsContext.java index 577d2d64943..9d80c40e7d3 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/innerhits/InnerHitsContext.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/innerhits/InnerHitsContext.java @@ -44,10 +44,10 @@ import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.search.SearchHitField; import org.elasticsearch.search.fetch.FetchSubPhase; import org.elasticsearch.search.internal.InternalSearchHit; diff --git a/core/src/main/java/org/elasticsearch/search/fetch/parent/ParentFieldSubFetchPhase.java b/core/src/main/java/org/elasticsearch/search/fetch/parent/ParentFieldSubFetchPhase.java index 6ace9a86a3e..8d6bcd1af6e 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/parent/ParentFieldSubFetchPhase.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/parent/ParentFieldSubFetchPhase.java @@ -23,7 +23,7 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.SortedDocValues; import org.apache.lucene.util.BytesRef; import org.elasticsearch.ExceptionsHelper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.search.SearchHitField; import org.elasticsearch.search.fetch.FetchSubPhase; import org.elasticsearch.search.internal.InternalSearchHitField; diff --git a/core/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java b/core/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java index 77a0e954b2d..6ecc1a2988a 100644 --- a/core/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java +++ b/core/src/main/java/org/elasticsearch/search/fetch/version/VersionFetchSubPhase.java @@ -23,7 +23,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.ElasticsearchException; import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.search.fetch.FetchSubPhase; import org.elasticsearch.search.internal.SearchContext; diff --git a/core/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java b/core/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java index e3f1f2fd0bb..5480291b973 100644 --- a/core/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java +++ b/core/src/main/java/org/elasticsearch/search/highlight/HighlightPhase.java @@ -25,10 +25,10 @@ import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; +import org.elasticsearch.index.mapper.KeywordFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.StringFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.search.fetch.FetchSubPhase; import org.elasticsearch.search.internal.SearchContext; diff --git a/core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java b/core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java index ffc6e4938c8..5e1b1ec9790 100644 --- a/core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java +++ b/core/src/main/java/org/elasticsearch/search/internal/DefaultSearchContext.java @@ -45,8 +45,8 @@ import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.ParsedQuery; import org.elasticsearch.index.query.QueryShardContext; diff --git a/core/src/main/java/org/elasticsearch/search/internal/FilteredSearchContext.java b/core/src/main/java/org/elasticsearch/search/internal/FilteredSearchContext.java index 6c646a62b6b..d187c88b4c9 100644 --- a/core/src/main/java/org/elasticsearch/search/internal/FilteredSearchContext.java +++ b/core/src/main/java/org/elasticsearch/search/internal/FilteredSearchContext.java @@ -32,7 +32,7 @@ import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.ParsedQuery; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.shard.IndexShard; diff --git a/core/src/main/java/org/elasticsearch/search/internal/SearchContext.java b/core/src/main/java/org/elasticsearch/search/internal/SearchContext.java index 3112212dc51..d8679d3fbbd 100644 --- a/core/src/main/java/org/elasticsearch/search/internal/SearchContext.java +++ b/core/src/main/java/org/elasticsearch/search/internal/SearchContext.java @@ -36,7 +36,7 @@ import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.ParsedQuery; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.shard.IndexShard; diff --git a/core/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java b/core/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java index b6b3a4613d8..905ac8991bf 100644 --- a/core/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/slice/SliceBuilder.java @@ -33,7 +33,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; diff --git a/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java b/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java index 7fb0baf6548..c8f15f3a1e8 100644 --- a/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/sort/SortBuilder.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.io.stream.NamedWriteable; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java index 4d118b64e50..f471d91c3b3 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggester.java @@ -39,9 +39,9 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.text.Text; import org.elasticsearch.index.fielddata.AtomicFieldData; import org.elasticsearch.index.fielddata.ScriptDocValues; +import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.Suggest; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java index 783b6536e2e..4b5b9cd4a8a 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java @@ -31,10 +31,10 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.index.mapper.CompletionFieldMapper; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.SuggestUtils; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionContext.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionContext.java index 6f656d1a8c7..84eb9de6a59 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionContext.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionContext.java @@ -20,8 +20,8 @@ package org.elasticsearch.search.suggest.completion; import org.apache.lucene.search.suggest.document.CompletionQuery; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; +import org.elasticsearch.index.mapper.CompletionFieldMapper; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.search.suggest.SuggestionSearchContext; import org.elasticsearch.search.suggest.completion.context.ContextMapping; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java index 305a3b1afd3..f41273662a4 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMapping.java @@ -25,8 +25,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java index ff550a8d34e..5a7cfccf315 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java @@ -27,9 +27,9 @@ import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java index a9aa9d340ca..854a5fb0e1a 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java @@ -30,9 +30,9 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import java.io.IOException; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/AnalyzingCompletionLookupProvider.java b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/AnalyzingCompletionLookupProvider.java index 48f0afc73cb..e9095bfb7d5 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/AnalyzingCompletionLookupProvider.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/AnalyzingCompletionLookupProvider.java @@ -46,8 +46,8 @@ import org.apache.lucene.util.fst.PairOutputs; import org.apache.lucene.util.fst.PairOutputs.Pair; import org.apache.lucene.util.fst.PositiveIntOutputs; import org.elasticsearch.common.regex.Regex; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; import org.elasticsearch.search.suggest.completion.CompletionStats; import org.elasticsearch.search.suggest.completion.CompletionSuggestionContext; import org.elasticsearch.search.suggest.completion.FuzzyOptions; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/Completion090PostingsFormat.java b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/Completion090PostingsFormat.java index b3b73306f97..5fcbf9db57b 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/Completion090PostingsFormat.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/Completion090PostingsFormat.java @@ -43,8 +43,8 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; import org.elasticsearch.search.suggest.completion.CompletionStats; import org.elasticsearch.search.suggest.completion.CompletionSuggestionContext; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/ContextBuilder.java b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/ContextBuilder.java index 16ef0053bbc..08917637f69 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/ContextBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/ContextBuilder.java @@ -22,6 +22,7 @@ package org.elasticsearch.search.suggest.completion2x.context; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.Version; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.MapperParsingException; import java.util.Map; import java.util.Map.Entry; diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/GeolocationContextMapping.java b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/GeolocationContextMapping.java index a5ed47db7c4..21031d36cc8 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/GeolocationContextMapping.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion2x/context/GeolocationContextMapping.java @@ -39,9 +39,9 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser.Token; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; import java.io.IOException; import java.util.ArrayList; diff --git a/core/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java b/core/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java index 24edbf47a2d..7806e575629 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java +++ b/core/src/test/java/org/elasticsearch/action/admin/indices/TransportAnalyzeActionTests.java @@ -28,7 +28,7 @@ import org.elasticsearch.env.Environment; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisRegistry; import org.elasticsearch.index.analysis.AnalysisService; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.indices.analysis.AnalysisModule; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.IndexSettingsModule; diff --git a/core/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java b/core/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java index ec608e0bf54..035f3b6599b 100644 --- a/core/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java +++ b/core/src/test/java/org/elasticsearch/action/termvectors/TermVectorsUnitTests.java @@ -44,10 +44,10 @@ import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.core.TypeParsers; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; +import org.elasticsearch.index.mapper.TypeParsers; import org.elasticsearch.rest.action.termvectors.RestTermVectorsAction; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.StreamsUtils; diff --git a/core/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityIT.java b/core/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityIT.java index a170fcd02f8..75f089b3488 100644 --- a/core/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityIT.java +++ b/core/src/test/java/org/elasticsearch/bwcompat/BasicBackwardsCompatibilityIT.java @@ -55,8 +55,8 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.VersionType; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortOrder; diff --git a/core/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityIT.java b/core/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityIT.java index 246bc69c2b3..4d728341d59 100644 --- a/core/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityIT.java +++ b/core/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityIT.java @@ -45,7 +45,7 @@ import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.gateway.MetaDataStateFormat; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.engine.Segment; -import org.elasticsearch.index.mapper.string.StringFieldMapperPositionIncrementGapTests; +import org.elasticsearch.index.mapper.StringFieldMapperPositionIncrementGapTests; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.node.Node; import org.elasticsearch.plugins.Plugin; diff --git a/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionLookupTests.java b/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionLookupTests.java index 72b6b2b5eec..a67a728edcc 100644 --- a/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionLookupTests.java +++ b/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionLookupTests.java @@ -32,8 +32,8 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.FixedBitSet; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.uid.Versions.DocIdAndVersion; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.test.ESTestCase; /** diff --git a/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionsTests.java b/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionsTests.java index b59b61b27f3..45693e101d4 100644 --- a/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionsTests.java +++ b/core/src/test/java/org/elasticsearch/common/lucene/uid/VersionsTests.java @@ -28,8 +28,8 @@ import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.test.ESTestCase; import org.hamcrest.MatcherAssert; diff --git a/core/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java b/core/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java index 595394dbfa9..442a566a77e 100644 --- a/core/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java +++ b/core/src/test/java/org/elasticsearch/deps/joda/SimpleJodaTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.deps.joda; import org.elasticsearch.common.joda.FormatDateTimeFormatter; import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.index.mapper.object.RootObjectMapper; +import org.elasticsearch.index.mapper.RootObjectMapper; import org.elasticsearch.test.ESTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/core/src/test/java/org/elasticsearch/explain/ExplainActionIT.java b/core/src/test/java/org/elasticsearch/explain/ExplainActionIT.java index 20d8846528c..7a64abc52ae 100644 --- a/core/src/test/java/org/elasticsearch/explain/ExplainActionIT.java +++ b/core/src/test/java/org/elasticsearch/explain/ExplainActionIT.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.InputStreamStreamInput; import org.elasticsearch.common.io.stream.OutputStreamStreamOutput; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.test.ESIntegTestCase; import org.joda.time.DateTime; diff --git a/core/src/test/java/org/elasticsearch/fieldstats/FieldStatsTests.java b/core/src/test/java/org/elasticsearch/fieldstats/FieldStatsTests.java index bfee11f7f0e..4a5f79a12a8 100644 --- a/core/src/test/java/org/elasticsearch/fieldstats/FieldStatsTests.java +++ b/core/src/test/java/org/elasticsearch/fieldstats/FieldStatsTests.java @@ -24,7 +24,7 @@ import org.elasticsearch.action.fieldstats.FieldStats; import org.elasticsearch.action.fieldstats.FieldStatsResponse; import org.elasticsearch.action.fieldstats.IndexConstraint; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.core.DateFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; diff --git a/core/src/test/java/org/elasticsearch/get/GetActionIT.java b/core/src/test/java/org/elasticsearch/get/GetActionIT.java index 932f42eaf0f..9d5e279c8f1 100644 --- a/core/src/test/java/org/elasticsearch/get/GetActionIT.java +++ b/core/src/test/java/org/elasticsearch/get/GetActionIT.java @@ -38,7 +38,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.engine.VersionConflictEngineException; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.test.ESIntegTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index e807652a117..6ae432dfbf7 100644 --- a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -80,9 +80,9 @@ import org.elasticsearch.index.mapper.Mapping; import org.elasticsearch.index.mapper.MetadataFieldMapper; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.object.RootObjectMapper; +import org.elasticsearch.index.mapper.RootObjectMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.DocsStats; import org.elasticsearch.index.shard.IndexSearcherWrapper; import org.elasticsearch.index.shard.ShardId; diff --git a/core/src/test/java/org/elasticsearch/index/engine/ShadowEngineTests.java b/core/src/test/java/org/elasticsearch/index/engine/ShadowEngineTests.java index 672686926bd..5083ddbd1d6 100644 --- a/core/src/test/java/org/elasticsearch/index/engine/ShadowEngineTests.java +++ b/core/src/test/java/org/elasticsearch/index/engine/ShadowEngineTests.java @@ -53,8 +53,8 @@ import org.elasticsearch.index.codec.CodecService; import org.elasticsearch.index.mapper.Mapping; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.RefreshListeners; import org.elasticsearch.index.shard.DocsStats; import org.elasticsearch.index.shard.ShardId; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java index 3849b78604c..96c70b3f55b 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/AbstractFieldDataTestCase.java @@ -39,21 +39,21 @@ import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; +import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.ContentPath; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; +import org.elasticsearch.index.mapper.LegacyByteFieldMapper; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper; +import org.elasticsearch.index.mapper.LegacyFloatFieldMapper; +import org.elasticsearch.index.mapper.LegacyIntegerFieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; +import org.elasticsearch.index.mapper.LegacyShortFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper.BuilderContext; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyByteFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyIntegerFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyShortFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.StringFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/FieldDataCacheTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/FieldDataCacheTests.java index 01ba314e9c3..e9b510592e5 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/FieldDataCacheTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/FieldDataCacheTests.java @@ -37,7 +37,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetDVOrdinalsIndexFieldData; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.breaker.NoneCircuitBreakerService; import org.elasticsearch.test.ESTestCase; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java index cc50ba5edfa..d15a50300ea 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/FilterFieldDataTests.java @@ -25,8 +25,8 @@ import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.RandomAccessOrds; import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.mapper.Mapper.BuilderContext; -import org.elasticsearch.index.mapper.core.TextFieldMapper; import java.util.Random; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java index bd6decfb60e..af60e2e7b09 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/IndexFieldDataServiceTests.java @@ -35,19 +35,19 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.fielddata.plain.SortedNumericDVIndexFieldData; import org.elasticsearch.index.fielddata.plain.SortedSetDVOrdinalsIndexFieldData; +import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.ContentPath; +import org.elasticsearch.index.mapper.KeywordFieldMapper; +import org.elasticsearch.index.mapper.LegacyByteFieldMapper; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper; +import org.elasticsearch.index.mapper.LegacyFloatFieldMapper; +import org.elasticsearch.index.mapper.LegacyIntegerFieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; +import org.elasticsearch.index.mapper.LegacyShortFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.NumberFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.mapper.Mapper.BuilderContext; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyByteFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyIntegerFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyShortFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java index dc980fcf0a9..e722e29bc42 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/ParentChildFieldDataTests.java @@ -39,9 +39,9 @@ import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.index.Index; import org.elasticsearch.index.fielddata.plain.ParentChildIndexFieldData; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.MultiValueMode; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/fielddata/plain/HalfFloatFielddataTests.java b/core/src/test/java/org/elasticsearch/index/fielddata/plain/HalfFloatFielddataTests.java index 8c2d9b684bc..af15114eae7 100644 --- a/core/src/test/java/org/elasticsearch/index/fielddata/plain/HalfFloatFielddataTests.java +++ b/core/src/test/java/org/elasticsearch/index/fielddata/plain/HalfFloatFielddataTests.java @@ -30,7 +30,7 @@ import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.TestUtil; import org.elasticsearch.index.fielddata.FieldData; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; +import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.test.ESTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/all/AllFieldMapperPositionIncrementGapTests.java b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperPositionIncrementGapTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/all/AllFieldMapperPositionIncrementGapTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperPositionIncrementGapTests.java index 7b106863341..0a51bb83359 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/all/AllFieldMapperPositionIncrementGapTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperPositionIncrementGapTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.all; +package org.elasticsearch.index.mapper; import org.elasticsearch.action.support.WriteRequest.RefreshPolicy; import org.elasticsearch.client.Client; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperTests.java index 817dc6e50df..091aa6003c9 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/all/SimpleAllMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.all; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.apache.lucene.index.Term; @@ -36,11 +36,11 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.engine.Engine.Searcher; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.internal.AllFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -59,7 +59,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class SimpleAllMapperTests extends ESSingleNodeTestCase { +public class AllFieldMapperTests extends ESSingleNodeTestCase { @Override protected Collection> getPlugins() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/AllFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/AllFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/AllFieldTypeTests.java index c71f6e06042..44e95b5dd71 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/AllFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/AllFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.AllFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; public class AllFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/binary/BinaryMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/mapper/binary/BinaryMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java index 4bf1d0c68f7..ace711ad38a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/binary/BinaryMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.binary; +package org.elasticsearch.index.mapper; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.bytes.BytesArray; @@ -27,10 +27,10 @@ import org.elasticsearch.common.compress.CompressorFactory; import org.elasticsearch.common.io.stream.BytesStreamOutput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.instanceOf; /** */ -public class BinaryMappingTests extends ESSingleNodeTestCase { +public class BinaryFieldMapperTests extends ESSingleNodeTestCase { public void testDefaultMapping() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/BinaryFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldTypeTests.java similarity index 91% rename from core/src/test/java/org/elasticsearch/index/mapper/core/BinaryFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldTypeTests.java index be5c85edf72..c6590daea3a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/BinaryFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/BinaryFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; public class BinaryFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java index 8ab89e83eca..86eb1ef9615 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.index.DirectoryReader; @@ -44,7 +44,6 @@ import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.string.SimpleStringMappingTests; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -176,9 +175,9 @@ public class BooleanFieldMapperTests extends ESSingleNodeTestCase { .endObject() .bytes()); Document doc = parsedDoc.rootDoc(); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "bool1")); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "bool2")); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "bool3")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "bool1")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "bool2")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "bool3")); } public void testBwCompatDocValues() throws Exception { @@ -211,8 +210,8 @@ public class BooleanFieldMapperTests extends ESSingleNodeTestCase { .endObject() .bytes()); Document doc = parsedDoc.rootDoc(); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "bool1")); - assertEquals(DocValuesType.NONE, SimpleStringMappingTests.docValuesType(doc, "bool2")); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "bool3")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "bool1")); + assertEquals(DocValuesType.NONE, LegacyStringMappingTests.docValuesType(doc, "bool2")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "bool3")); } } diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldTypeTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldTypeTests.java index 821daa6a54c..4f52fcd187d 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/BooleanFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/BooleanFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.Term; import org.apache.lucene.search.TermQuery; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CamelCaseFieldNameTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CamelCaseFieldNameTests.java index ea142d6f441..d8894139cfa 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/camelcase/CamelCaseFieldNameTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CamelCaseFieldNameTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.camelcase; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapper2xTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapper2xTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapper2xTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapper2xTests.java index 51000f42472..601909d8e07 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapper2xTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapper2xTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.completion; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; @@ -25,9 +25,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.json.JsonXContent; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java index 6de07d8cd0f..69447d24fd0 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/completion/CompletionFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldMapperTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.completion; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.apache.lucene.search.Query; @@ -36,12 +36,12 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.analysis.NamedAnalyzer; +import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/CompletionFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldTypeTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/core/CompletionFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldTypeTests.java index 6f5225dd2c1..587ac2e0605 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/CompletionFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CompletionFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.CompletionFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.search.suggest.completion.context.ContextBuilder; import org.elasticsearch.search.suggest.completion.context.ContextMappings; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CompoundTypesTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CompoundTypesTests.java index 79ede4a80cb..1c00f821996 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/compound/CompoundTypesTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CompoundTypesTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.compound; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperIntegrationIT.java b/core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperIntegrationIT.java rename to core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java index a65aae4ab20..11f8512fd25 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperIntegrationIT.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.copyto; +package org.elasticsearch.index.mapper; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.xcontent.XContentBuilder; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java index d4434b97423..e71ac5b492c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/copyto/CopyToMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CopyToMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.copyto; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesReference; @@ -31,13 +31,13 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.util.Arrays; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/CustomBoostMappingTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/CustomBoostMappingTests.java index 9974fd5b695..9bc87e874f9 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/boost/CustomBoostMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/CustomBoostMappingTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.boost; +package org.elasticsearch.index.mapper; import org.apache.lucene.search.BoostQuery; import org.apache.lucene.search.TermQuery; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java index a3909637548..f0e4e8c15ac 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DateFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java index 62bfae40a37..bdeaa6921de 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/DateFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DateFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import java.io.IOException; import java.util.Locale; @@ -34,11 +34,12 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; import org.elasticsearch.common.joda.DateMathParser; import org.elasticsearch.common.joda.Joda; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.core.DateFieldMapper.DateFieldType; import org.joda.time.DateTimeZone; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperMergeTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperMergeTests.java index 0133d3e5943..a9b1753ba1c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/merge/TestMergeMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperMergeTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.merge; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; @@ -29,8 +29,8 @@ import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.Mapping; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.object.ObjectMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; @@ -43,7 +43,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class TestMergeMapperTests extends ESSingleNodeTestCase { +public class DocumentMapperMergeTests extends ESSingleNodeTestCase { public void test1Merge() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperParserTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperParserTests.java index 3041cc8d13c..43801b03cb9 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseMappingTypeLevelTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DocumentMapperParserTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.typelevels; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentFactory; @@ -28,7 +28,7 @@ import org.elasticsearch.test.ESSingleNodeTestCase; import static org.hamcrest.Matchers.equalTo; // TODO: move this test...it doesn't need to be by itself -public class ParseMappingTypeLevelTests extends ESSingleNodeTestCase { +public class DocumentMapperParserTests extends ESSingleNodeTestCase { public void testTypeLevel() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("_all").field("enabled", false).endObject() diff --git a/core/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java index 632f2cef7fb..38fee23fad6 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DocumentParserTests.java @@ -19,20 +19,24 @@ package org.elasticsearch.index.mapper; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; +import org.elasticsearch.index.IndexService; +import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.test.ESSingleNodeTestCase; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.elasticsearch.test.StreamsUtils.copyToBytesFromClasspath; +import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; +import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; // TODO: make this a real unit test @@ -877,4 +881,291 @@ public class DocumentParserTests extends ESSingleNodeTestCase { BytesReference bytes2 = XContentFactory.jsonBuilder().startObject().field("foo._ttl", 0).endObject().bytes(); mapper.parse("test", "type", "1", bytes2); // parses without error } + + public void testSimpleMapper() throws Exception { + IndexService indexService = createIndex("test"); + DocumentMapper docMapper = new DocumentMapper.Builder( + new RootObjectMapper.Builder("person") + .add(new ObjectMapper.Builder("name").add(new TextFieldMapper.Builder("first").store(true).index(false))), + indexService.mapperService()).build(indexService.mapperService()); + + BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); + Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); + + assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); + doc = docMapper.parse("test", "person", "1", json).rootDoc(); + } + + public void testParseToJsonAndParse() throws Exception { + String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); + DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); + DocumentMapper docMapper = parser.parse("person", new CompressedXContent(mapping)); + String builtMapping = docMapper.mappingSource().string(); + // reparse it + DocumentMapper builtDocMapper = parser.parse("person", new CompressedXContent(builtMapping)); + BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); + Document doc = builtDocMapper.parse("test", "person", "1", json).rootDoc(); + assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); + } + + public void testSimpleParser() throws Exception { + String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); + DocumentMapper docMapper = createIndex("test").mapperService().documentMapperParser().parse("person", new CompressedXContent(mapping)); + + assertThat((String) docMapper.meta().get("param1"), equalTo("value1")); + + BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); + Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); + assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); + } + + public void testSimpleParserNoTypeNoId() throws Exception { + String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); + DocumentMapper docMapper = createIndex("test").mapperService().documentMapperParser().parse("person", new CompressedXContent(mapping)); + BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1-notype-noid.json")); + Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); + assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); + assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); + } + + public void testAttributes() throws Exception { + String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); + DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); + DocumentMapper docMapper = parser.parse("person", new CompressedXContent(mapping)); + + assertThat((String) docMapper.meta().get("param1"), equalTo("value1")); + + String builtMapping = docMapper.mappingSource().string(); + DocumentMapper builtDocMapper = parser.parse("person", new CompressedXContent(builtMapping)); + assertThat((String) builtDocMapper.meta().get("param1"), equalTo("value1")); + } + + public void testNoDocumentSent() throws Exception { + IndexService indexService = createIndex("test"); + DocumentMapper docMapper = new DocumentMapper.Builder( + new RootObjectMapper.Builder("person") + .add(new ObjectMapper.Builder("name").add(new TextFieldMapper.Builder("first").store(true).index(false))), + indexService.mapperService()).build(indexService.mapperService()); + + BytesReference json = new BytesArray("".getBytes(StandardCharsets.UTF_8)); + try { + docMapper.parse("test", "person", "1", json).rootDoc(); + fail("this point is never reached"); + } catch (MapperParsingException e) { + assertThat(e.getMessage(), equalTo("failed to parse, document is empty")); + } + } + + public void testHazardousFieldNames() throws Exception { + IndexService indexService = createIndex("test"); + DocumentMapperParser mapperParser = indexService.mapperService().documentMapperParser(); + String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties") + .startObject("foo.bar").field("type", "text").endObject() + .endObject().endObject().endObject().string(); + try { + mapperParser.parse("type", new CompressedXContent(mapping)); + fail("Mapping parse should have failed"); + } catch (MapperParsingException e) { + assertTrue(e.getMessage(), e.getMessage().contains("cannot contain '.'")); + } + } + + public void testNoLevel() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject() + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject() + .bytes()); + + assertThat(doc.rootDoc().get("test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); + } + + public void testTypeLevel() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } + + public void testNoLevelWithFieldTypeAsValue() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject() + .field("type", "value_type") + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type"), equalTo("value_type")); + assertThat(doc.rootDoc().get("test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); + } + + public void testTypeLevelWithFieldTypeAsValue() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .field("type", "value_type") + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } + + public void testNoLevelWithFieldTypeAsObject() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject() + .startObject("type").field("type_field", "type_value").endObject() + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject() + .bytes()); + + // in this case, we analyze the type object as the actual document, and ignore the other same level fields + assertThat(doc.rootDoc().get("type.type_field"), equalTo("type_value")); + assertThat(doc.rootDoc().get("test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("test2"), equalTo("value2")); + } + + public void testTypeLevelWithFieldTypeAsObject() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .startObject("type").field("type_field", "type_value").endObject() + .field("test1", "value1") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.type.type_field"), equalTo("type_value")); + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } + + public void testNoLevelWithFieldTypeAsValueNotFirst() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .field("test1", "value1") + .field("test2", "value2") + .field("type", "value_type") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } + + public void testTypeLevelWithFieldTypeAsValueNotFirst() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .field("test1", "value1") + .field("type", "value_type") + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } + + public void testNoLevelWithFieldTypeAsObjectNotFirst() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject() + .field("test1", "value1") + .startObject("type").field("type_field", "type_value").endObject() + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject() + .bytes()); + + // when the type is not the first one, we don't confuse it... + assertThat(doc.rootDoc().get("type.type_field"), equalTo("type_value")); + assertThat(doc.rootDoc().get("test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); + } + + public void testTypeLevelWithFieldTypeAsObjectNotFirst() throws Exception { + String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); + + DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); + + ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() + .startObject().startObject("type") + .field("test1", "value1") + .startObject("type").field("type_field", "type_value").endObject() + .field("test2", "value2") + .startObject("inner").field("inner_field", "inner_value").endObject() + .endObject().endObject() + .bytes()); + + assertThat(doc.rootDoc().get("type.type.type_field"), equalTo("type_value")); + assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); + assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); + assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); + } } diff --git a/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DoubleIndexingDocTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DoubleIndexingDocTests.java index 05677d0ed8f..62189aaa87a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/lucene/DoubleIndexingDocTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DoubleIndexingDocTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.lucene; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexReader; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java index 76ee2efa7ea..4d593318f54 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DynamicMappingTests.java @@ -31,14 +31,9 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper.BooleanFieldType; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.DateFieldMapper.DateFieldType; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper.NumberFieldType; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.BooleanFieldMapper.BooleanFieldType; +import org.elasticsearch.index.mapper.DateFieldMapper.DateFieldType; +import org.elasticsearch.index.mapper.NumberFieldMapper.NumberFieldType; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java index 0de3c5d4a30..9830488989c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplateTests.java @@ -23,8 +23,7 @@ import org.elasticsearch.Version; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.mapper.object.DynamicTemplate; -import org.elasticsearch.index.mapper.object.DynamicTemplate.XContentFieldType; +import org.elasticsearch.index.mapper.DynamicTemplate.XContentFieldType; import org.elasticsearch.test.ESTestCase; import java.util.Collections; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java b/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java index 12372c990d7..9e4eb14e378 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/simple/SimpleDynamicTemplatesTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/DynamicTemplatesTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.dynamictemplate.simple; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; @@ -41,7 +41,7 @@ import static org.hamcrest.Matchers.equalTo; /** * */ -public class SimpleDynamicTemplatesTests extends ESSingleNodeTestCase { +public class DynamicTemplatesTests extends ESSingleNodeTestCase { public void testMatchTypeOnly() throws Exception { XContentBuilder builder = JsonXContent.contentBuilder(); builder.startObject().startObject("person").startArray("dynamic_templates").startObject().startObject("test") diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/SimpleExternalMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/SimpleExternalMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java index 9f7d878e26f..f1541ed02b9 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/SimpleExternalMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ExternalFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import org.apache.lucene.spatial.geopoint.document.GeoPointField; import org.apache.lucene.util.BytesRef; @@ -29,10 +29,10 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.indices.mapper.MapperRegistry; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.notNullValue; /** */ -public class SimpleExternalMappingTests extends ESSingleNodeTestCase { +public class ExternalFieldMapperTests extends ESSingleNodeTestCase { @Override protected Collection> getPlugins() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMapper.java similarity index 94% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java rename to core/src/test/java/org/elasticsearch/index/mapper/ExternalMapper.java index a1571e47527..7d44b1fc480 100755 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapper.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import org.locationtech.spatial4j.shape.Point; import org.apache.lucene.document.Field; @@ -27,19 +27,19 @@ import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.geo.builders.ShapeBuilders; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.BinaryFieldMapper; +import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.TermBasedFieldType; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapperLegacy; -import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import java.io.IOException; import java.nio.charset.Charset; @@ -48,7 +48,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseField; +import static org.elasticsearch.index.mapper.TypeParsers.parseField; /** * This mapper add a new sub fields diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapperPlugin.java b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMapperPlugin.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapperPlugin.java rename to core/src/test/java/org/elasticsearch/index/mapper/ExternalMapperPlugin.java index 81b7375ab2e..467bc18a33a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMapperPlugin.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMapperPlugin.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import java.util.Collections; import java.util.HashMap; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMetadataMapper.java b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMetadataMapper.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMetadataMapper.java rename to core/src/test/java/org/elasticsearch/index/mapper/ExternalMetadataMapper.java index 9223b640024..6d585b7e7e7 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalMetadataMapper.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ExternalMetadataMapper.java @@ -17,19 +17,19 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.mapper.BooleanFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MetadataFieldMapper; import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.BooleanFieldMapper; import java.io.IOException; import java.util.Collections; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalValuesMapperIntegrationIT.java b/core/src/test/java/org/elasticsearch/index/mapper/ExternalValuesMapperIntegrationIT.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalValuesMapperIntegrationIT.java rename to core/src/test/java/org/elasticsearch/index/mapper/ExternalValuesMapperIntegrationIT.java index 99dcaebbc6f..fac6db6ad8c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/ExternalValuesMapperIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ExternalValuesMapperIntegrationIT.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.geo.ShapeRelation; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/FakeStringFieldMapper.java b/core/src/test/java/org/elasticsearch/index/mapper/FakeStringFieldMapper.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/externalvalues/FakeStringFieldMapper.java rename to core/src/test/java/org/elasticsearch/index/mapper/FakeStringFieldMapper.java index 09063d685c6..5a7c38ac05d 100755 --- a/core/src/test/java/org/elasticsearch/index/mapper/externalvalues/FakeStringFieldMapper.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/FakeStringFieldMapper.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.externalvalues; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.document.SortedSetDocValuesField; @@ -32,14 +32,14 @@ import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext; +import org.elasticsearch.index.mapper.StringFieldMapper; import org.elasticsearch.index.mapper.StringFieldType; -import org.elasticsearch.index.mapper.core.StringFieldMapper; import java.io.IOException; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseTextField; +import static org.elasticsearch.index.mapper.TypeParsers.parseTextField; // Like a String mapper but with very few options. We just use it to test if highlighting on a custom string mapped field works as expected. public class FakeStringFieldMapper extends FieldMapper { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java b/core/src/test/java/org/elasticsearch/index/mapper/FieldLevelBoostTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/FieldLevelBoostTests.java index 9405a23eb03..2d451a36df8 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/boost/FieldLevelBoostTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/FieldLevelBoostTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.boost; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.elasticsearch.Version; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java index 11804ab1d2c..baa9f728019 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; @@ -30,6 +30,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldTypeTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldTypeTests.java index f6ed0cf931d..b3c9da806fa 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/FieldNamesFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GenericStoreDynamicTemplateTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GenericStoreDynamicTemplateTests.java index b013f9b4a56..65ed7845af7 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/genericstore/GenericStoreDynamicTemplateTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GenericStoreDynamicTemplateTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.dynamictemplate.genericstore; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoEncodingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeoEncodingTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeoEncodingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeoEncodingTests.java index 89dcbf89600..63377ca963f 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoEncodingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeoEncodingTests.java @@ -17,12 +17,13 @@ * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.geo.GeoDistance; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.unit.DistanceUnit.Distance; +import org.elasticsearch.index.mapper.GeoPointFieldMapperLegacy; import org.elasticsearch.test.ESTestCase; import java.util.Arrays; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java index d4d0dea6e39..9262c6d0d6d 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldMapperTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.apache.lucene.spatial.geopoint.document.GeoPointField; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldTypeTests.java similarity index 88% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldTypeTests.java index 0c209c25d52..6e6222ac871 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoPointFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeoPointFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper; +import org.elasticsearch.index.mapper.StringFieldMapper; import org.junit.Before; public class GeoPointFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java index 0ad4dbd87ba..65856b7afa0 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.apache.lucene.spatial.prefix.PrefixTreeStrategy; import org.apache.lucene.spatial.prefix.RecursivePrefixTreeStrategy; @@ -29,6 +29,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldTypeTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldTypeTests.java index 3407661b521..41ae4bdfbe4 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeoShapeFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.geo.builders.ShapeBuilder; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java b/core/src/test/java/org/elasticsearch/index/mapper/GeohashMappingGeoPointTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/GeohashMappingGeoPointTests.java index 8c018d7e4d6..05581e79021 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/geo/GeohashMappingGeoPointTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/GeohashMappingGeoPointTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.geo; +package org.elasticsearch.index.mapper; import org.apache.lucene.spatial.geopoint.document.GeoPointField; import org.apache.lucene.util.BytesRef; @@ -26,6 +26,7 @@ import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.ParsedDocument; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IdFieldMapperTests.java similarity index 92% rename from core/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IdFieldMapperTests.java index 602275d6559..55b6e7bf71c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/id/IdMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IdFieldMapperTests.java @@ -17,22 +17,22 @@ * under the License. */ -package org.elasticsearch.index.mapper.id; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class IdMappingTests extends ESSingleNodeTestCase { +public class IdFieldMapperTests extends ESSingleNodeTestCase { public void testId() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/IdFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IdFieldTypeTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/IdFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IdFieldTypeTests.java index bddd55429aa..1cd9063da5f 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/IdFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IdFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; public class IdFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IndexFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IndexFieldMapperTests.java index 1460672e489..eb74297e8e4 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/index/IndexTypeMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IndexFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.index; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.nullValue; import java.io.IOException; import java.util.Collection; -public class IndexTypeMapperTests extends ESSingleNodeTestCase { +public class IndexFieldMapperTests extends ESSingleNodeTestCase { @Override protected Collection> getPlugins() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/IndexFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IndexFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/IndexFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IndexFieldTypeTests.java index 739ec0bdfb8..ecea620f11c 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/IndexFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IndexFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.IndexFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; public class IndexFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java index d99b37fc667..68ef2c2dd56 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IpFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.InetAddressPoint; import org.apache.lucene.index.DocValuesType; @@ -31,6 +31,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.IpFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/IpFieldTypeTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/IpFieldTypeTests.java index 884f52cc0ed..a5a1423d210 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/ip/IpFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/IpFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import java.net.InetAddress; @@ -25,7 +25,7 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.network.InetAddresses; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.IpFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; public class IpFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java index e08d610d3f2..817480db3d3 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/multifield/merge/JavaMultiFieldMergeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/JavaMultiFieldMergeTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.multifield.merge; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java index 0e9680b5252..9c4eed15bc9 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexOptions; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldTypeTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldTypeTests.java index 77360c12fda..2f54af2601b 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/KeywordFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/KeywordFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import com.carrotsearch.randomizedtesting.generators.RandomStrings; @@ -27,10 +27,10 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.KeywordFieldMapper.KeywordFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType; import java.io.IOException; import java.util.Arrays; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyByteFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyByteFieldTypeTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyByteFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyByteFieldTypeTests.java index 720fc5b4357..1f24acd4c20 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyByteFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyByteFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyByteFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/date/LegacyDateMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldMapperTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/date/LegacyDateMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldMapperTests.java index 92f9a9958fb..284581a844e 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/date/LegacyDateMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.date; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.LegacyNumericTokenStream.LegacyNumericTermAttribute; import org.apache.lucene.analysis.TokenStream; @@ -42,13 +42,13 @@ import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.internal.SearchContext; import org.elasticsearch.test.ESSingleNodeTestCase; @@ -66,7 +66,7 @@ import java.util.Locale; import java.util.Map; import static com.carrotsearch.randomizedtesting.RandomizedTest.systemPropertyAsBoolean; -import static org.elasticsearch.index.mapper.string.SimpleStringMappingTests.docValuesType; +import static org.elasticsearch.index.mapper.LegacyStringMappingTests.docValuesType; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasKey; import static org.hamcrest.Matchers.instanceOf; @@ -74,7 +74,7 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.nullValue; -public class LegacyDateMappingTests extends ESSingleNodeTestCase { +public class LegacyDateFieldMapperTests extends ESSingleNodeTestCase { private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_3_0).build(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDateFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldTypeTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDateFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldTypeTests.java index 6c47f40c0c0..03137ceffd1 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDateFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDateFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.LegacyLongField; @@ -29,11 +29,11 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; import org.elasticsearch.common.joda.DateMathParser; import org.elasticsearch.common.joda.Joda; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper.DateFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper.DateFieldType; import org.joda.time.DateTimeZone; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDoubleFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyDoubleFieldTypeTests.java index 65660776d29..87feb396483 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyDoubleFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyDoubleFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper.DoubleFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper.DoubleFieldType; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyFloatFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyFloatFieldTypeTests.java index d75f9583458..17da3c88ea4 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyFloatFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyFloatFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyFloatFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.LegacyFloatFieldMapper.FloatFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper.FloatFieldType; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyIntegerFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyIntegerFieldTypeTests.java index 9f3fb41e476..e0acbcdd127 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyIntegerFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyIntegerFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyIntegerFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.LegacyIntegerFieldMapper.IntegerFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.LegacyIntegerFieldMapper.IntegerFieldType; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/ip/LegacyIpMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyIpFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/ip/LegacyIpMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyIpFieldMapperTests.java index 35eac98f580..af525318640 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/ip/LegacyIpMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyIpFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.ip; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; @@ -25,6 +25,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.LegacyIpFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.plugins.Plugin; @@ -42,7 +43,7 @@ import static org.hamcrest.Matchers.nullValue; /** * */ -public class LegacyIpMappingTests extends ESSingleNodeTestCase { +public class LegacyIpFieldMapperTests extends ESSingleNodeTestCase { private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_3_0).build(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyLongFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyLongFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyLongFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyLongFieldTypeTests.java index a52c72a5cc3..78d30462d22 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyLongFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyLongFieldTypeTests.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper.LongFieldType; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper.LongFieldType; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/numeric/LegacyNumericTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/numeric/LegacyNumericTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapperTests.java index 812324a1423..46bd89f83e0 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/numeric/LegacyNumericTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyNumberFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.numeric; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.LegacyNumericTokenStream; import org.apache.lucene.analysis.TokenStream; @@ -34,14 +34,13 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.LegacyFloatFieldMapper; +import org.elasticsearch.index.mapper.LegacyLongFieldMapper; +import org.elasticsearch.index.mapper.LegacyNumberFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.LegacyFloatFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyLongFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.string.SimpleStringMappingTests; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -58,7 +57,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class LegacyNumericTests extends ESSingleNodeTestCase { +public class LegacyNumberFieldMapperTests extends ESSingleNodeTestCase { private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_3_0).build(); @@ -261,10 +260,10 @@ public class LegacyNumericTests extends ESSingleNodeTestCase { .endObject() .bytes()); Document doc = parsedDoc.rootDoc(); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "int1")); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "double1")); - assertEquals(DocValuesType.NONE, SimpleStringMappingTests.docValuesType(doc, "int2")); - assertEquals(DocValuesType.NONE, SimpleStringMappingTests.docValuesType(doc, "double2")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "int1")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "double1")); + assertEquals(DocValuesType.NONE, LegacyStringMappingTests.docValuesType(doc, "int2")); + assertEquals(DocValuesType.NONE, LegacyStringMappingTests.docValuesType(doc, "double2")); } public void testUnIndex() throws IOException { @@ -360,8 +359,8 @@ public class LegacyNumericTests extends ESSingleNodeTestCase { if (doc == parsedDoc.rootDoc()) { continue; } - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "nested.int")); - assertEquals(DocValuesType.SORTED_NUMERIC, SimpleStringMappingTests.docValuesType(doc, "nested.double")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "nested.int")); + assertEquals(DocValuesType.SORTED_NUMERIC, LegacyStringMappingTests.docValuesType(doc, "nested.double")); } } diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyShortFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyShortFieldTypeTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyShortFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyShortFieldTypeTests.java index 7501eb5cf1f..be5a6a4e0c3 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyShortFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyShortFieldTypeTests.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; +import org.elasticsearch.index.mapper.LegacyShortFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyStringMappingTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyStringMappingTests.java index f6dc921687d..e0cfce61af0 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/string/SimpleStringMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyStringMappingTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.string; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexOptions; @@ -41,10 +41,10 @@ import org.elasticsearch.index.mapper.Mapper.BuilderContext; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParseContext.Document; +import org.elasticsearch.index.mapper.StringFieldMapper.Builder; +import org.elasticsearch.index.mapper.StringFieldMapper.StringFieldType; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.core.StringFieldMapper; -import org.elasticsearch.index.mapper.core.StringFieldMapper.Builder; -import org.elasticsearch.index.mapper.core.StringFieldMapper.StringFieldType; +import org.elasticsearch.index.mapper.StringFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -64,7 +64,7 @@ import static org.hamcrest.Matchers.nullValue; /** */ -public class SimpleStringMappingTests extends ESSingleNodeTestCase { +public class LegacyStringMappingTests extends ESSingleNodeTestCase { @Override protected Collection> getPlugins() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapperTests.java index ea5bdab132a..125c6fbc830 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/LegacyTokenCountFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/LegacyTokenCountFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CannedTokenStream; @@ -31,6 +31,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.LegacyTokenCountFieldMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java index 2afeb02499d..4eaf58a602f 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java @@ -34,9 +34,9 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; +import org.elasticsearch.index.mapper.KeywordFieldMapper.KeywordFieldType; import org.elasticsearch.index.mapper.MapperService.MergeReason; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper.KeywordFieldType; -import org.elasticsearch.index.mapper.core.NumberFieldMapper.NumberFieldType; +import org.elasticsearch.index.mapper.NumberFieldMapper.NumberFieldType; import org.elasticsearch.test.ESSingleNodeTestCase; import static org.hamcrest.CoreMatchers.containsString; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/MultiFieldCopyToMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldCopyToMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/MultiFieldCopyToMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/MultiFieldCopyToMapperTests.java index 0ac7945e327..f2b65f0f976 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/MultiFieldCopyToMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldCopyToMapperTests.java @@ -18,7 +18,7 @@ */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java index ac8b1a87915..4bf1995722b 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.multifield; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; @@ -29,16 +29,16 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.IndexService; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.RootObjectMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; +import org.elasticsearch.index.mapper.TokenCountFieldMapper; import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.core.TokenCountFieldMapper; -import org.elasticsearch.index.mapper.object.RootObjectMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldsIntegrationIT.java b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldsIntegrationIT.java rename to core/src/test/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java index 8e10ba9f007..e11f0b90e85 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldsIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/MultiFieldsIntegrationIT.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.multifield; +package org.elasticsearch.index.mapper; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.search.SearchResponse; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java index ddae147a802..89a42a884c6 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/nested/NestedMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/NestedObjectMapperTests.java @@ -17,18 +17,18 @@ * under the License. */ -package org.elasticsearch.index.mapper.nested; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ObjectMapper; import org.elasticsearch.index.mapper.MapperService.MergeReason; +import org.elasticsearch.index.mapper.ObjectMapper.Dynamic; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper.Dynamic; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; @@ -39,7 +39,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.nullValue; -public class NestedMappingTests extends ESSingleNodeTestCase { +public class NestedObjectMapperTests extends ESSingleNodeTestCase { public void testEmptyNested() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties") .startObject("nested1").field("type", "nested").endObject() diff --git a/core/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java index 0a03601ea62..774e122e13f 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/object/NullValueObjectMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/NullValueObjectMappingTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentFactory; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/null_value/NullValueTests.java b/core/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/null_value/NullValueTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java index 2ff4799bcb0..0880833716e 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/null_value/NullValueTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/NullValueTests.java @@ -1,4 +1,4 @@ -package org.elasticsearch.index.mapper.null_value; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java index 45cc09fff0e..8375e54d399 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/NumberFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java index 4b516434b77..c887565ae69 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/NumberFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/NumberFieldTypeTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import com.carrotsearch.randomizedtesting.generators.RandomPicks; @@ -33,10 +33,10 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType.Relation; -import org.elasticsearch.index.mapper.core.NumberFieldMapper.NumberType; +import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java index 907616712a2..b5a31e49a60 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/object/SimpleObjectMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ObjectMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.object; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; @@ -28,7 +28,7 @@ import org.elasticsearch.test.ESSingleNodeTestCase; import static org.hamcrest.Matchers.containsString; -public class SimpleObjectMappingTests extends ESSingleNodeTestCase { +public class ObjectMapperTests extends ESSingleNodeTestCase { public void testDifferentInnerObjectTokenFailure() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .endObject().endObject().string(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ParentFieldMapperTests.java similarity index 72% rename from core/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ParentFieldMapperTests.java index bea54cc1b56..15738ada3bc 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/parent/ParentMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ParentFieldMapperTests.java @@ -16,9 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.parent; +package org.elasticsearch.index.mapper; +import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; +import org.elasticsearch.Version; +import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; @@ -29,9 +32,12 @@ import org.elasticsearch.index.Index; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.analysis.AnalysisService; +import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.ParentFieldMapper; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParsedDocument; @@ -47,8 +53,10 @@ import java.util.Set; import static java.util.Collections.emptyList; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; +import static org.hamcrest.Matchers.equalTo; +import static org.hamcrest.Matchers.is; -public class ParentMappingTests extends ESSingleNodeTestCase { +public class ParentFieldMapperTests extends ESSingleNodeTestCase { public void testParentSetInDocNotAllowed() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") @@ -127,4 +135,42 @@ public class ParentMappingTests extends ESSingleNodeTestCase { } return numFieldWithParentPrefix; } + + public void testPost2Dot0LazyLoading() { + ParentFieldMapper.Builder builder = new ParentFieldMapper.Builder("child"); + builder.type("parent"); + builder.eagerGlobalOrdinals(false); + + ParentFieldMapper parentFieldMapper = builder.build(new Mapper.BuilderContext(post2Dot0IndexSettings(), new ContentPath(0))); + + assertThat(parentFieldMapper.getParentJoinFieldType().name(), equalTo("_parent#child")); + assertThat(parentFieldMapper.getParentJoinFieldType().hasDocValues(), is(true)); + assertThat(parentFieldMapper.getParentJoinFieldType().docValuesType(), equalTo(DocValuesType.SORTED)); + + assertThat(parentFieldMapper.fieldType().name(), equalTo("_parent#parent")); + assertThat(parentFieldMapper.fieldType().eagerGlobalOrdinals(), equalTo(false)); + assertThat(parentFieldMapper.fieldType().hasDocValues(), is(true)); + assertThat(parentFieldMapper.fieldType().docValuesType(), equalTo(DocValuesType.SORTED)); + } + + public void testPost2Dot0EagerLoading() { + ParentFieldMapper.Builder builder = new ParentFieldMapper.Builder("child"); + builder.type("parent"); + builder.eagerGlobalOrdinals(true); + + ParentFieldMapper parentFieldMapper = builder.build(new Mapper.BuilderContext(post2Dot0IndexSettings(), new ContentPath(0))); + + assertThat(parentFieldMapper.getParentJoinFieldType().name(), equalTo("_parent#child")); + assertThat(parentFieldMapper.getParentJoinFieldType().hasDocValues(), is(true)); + assertThat(parentFieldMapper.getParentJoinFieldType().docValuesType(), equalTo(DocValuesType.SORTED)); + + assertThat(parentFieldMapper.fieldType().name(), equalTo("_parent#parent")); + assertThat(parentFieldMapper.fieldType().eagerGlobalOrdinals(), equalTo(true)); + assertThat(parentFieldMapper.fieldType().hasDocValues(), is(true)); + assertThat(parentFieldMapper.fieldType().docValuesType(), equalTo(DocValuesType.SORTED)); + } + + private static Settings post2Dot0IndexSettings() { + return Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_1_0).build(); + } } diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ParentFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ParentFieldTypeTests.java index 79cd0e85bda..64adad9aa48 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ParentFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.ParentFieldMapper; public class ParentFieldTypeTests extends FieldTypeTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/PathMapperTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/PathMapperTests.java index 715eefca9e6..1f6fb29e4c1 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/path/PathMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/PathMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.path; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.index.mapper.DocumentMapper; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java b/core/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java index 75dd396d8dd..584ba2daf1d 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/PathMatchDynamicTemplateTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/PathMatchDynamicTemplateTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.dynamictemplate.pathmatch; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java similarity index 95% rename from core/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java index 0440019310b..92e93ede9aa 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/routing/RoutingTypeMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.routing; +package org.elasticsearch.index.mapper; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentFactory; @@ -29,7 +29,7 @@ import org.elasticsearch.test.ESSingleNodeTestCase; import static org.hamcrest.Matchers.equalTo; -public class RoutingTypeMapperTests extends ESSingleNodeTestCase { +public class RoutingFieldMapperTests extends ESSingleNodeTestCase { public void testRoutingMapper() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/RoutingFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/RoutingFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldTypeTests.java index 44a5f7db7cf..d64c4c5b0cf 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/RoutingFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/RoutingFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.RoutingFieldMapper; public class RoutingFieldTypeTests extends FieldTypeTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapperTests.java index aa14fc3495c..e72bb631ad3 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexableField; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldTypeTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldTypeTests.java index 2b05c4cc589..b3cbaa291b4 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/ScaledFloatFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/ScaledFloatFieldTypeTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Document; import org.apache.lucene.document.DoublePoint; @@ -38,8 +38,9 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.fielddata.AtomicNumericFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.NumberFieldMapper; +import org.elasticsearch.index.mapper.ScaledFloatFieldMapper; import org.junit.Before; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/source/DefaultSourceMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/source/DefaultSourceMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java index f82dcb6eecc..169a7e1d90a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/source/DefaultSourceMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/SourceFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.source; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexableField; import org.elasticsearch.Version; @@ -45,7 +45,7 @@ import java.util.Map; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; -public class DefaultSourceMappingTests extends ESSingleNodeTestCase { +public class SourceFieldMapperTests extends ESSingleNodeTestCase { @Override protected Collection> getPlugins() { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/SourceFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/SourceFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/SourceFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/SourceFieldTypeTests.java index 2b0afae5f87..a1c7298d7ad 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/SourceFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/SourceFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.SourceFieldMapper; public class SourceFieldTypeTests extends FieldTypeTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java b/core/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java index 7b2bfc78a93..4bfdd07d455 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/lucene/StoredNumericValuesTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/StoredNumericValuesTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.lucene; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.IndexWriter; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/string/StringFieldMapperPositionIncrementGapTests.java b/core/src/test/java/org/elasticsearch/index/mapper/StringFieldMapperPositionIncrementGapTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/string/StringFieldMapperPositionIncrementGapTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/StringFieldMapperPositionIncrementGapTests.java index 88f815611e2..6a68c537da1 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/string/StringFieldMapperPositionIncrementGapTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/StringFieldMapperPositionIncrementGapTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.string; +package org.elasticsearch.index.mapper; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.Version; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/StringFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/StringFieldTypeTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/core/StringFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/StringFieldTypeTests.java index 49b19d258f6..558253c463d 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/StringFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/StringFieldTypeTests.java @@ -16,11 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.FieldTypeTestCase.Modifier; +import org.elasticsearch.index.mapper.StringFieldMapper; import org.junit.Before; public class StringFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/StringMappingUpgradeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/StringMappingUpgradeTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/core/StringMappingUpgradeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/StringMappingUpgradeTests.java index 11c0011838e..41077493761 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/StringMappingUpgradeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/StringMappingUpgradeTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import com.carrotsearch.randomizedtesting.generators.RandomPicks; @@ -33,9 +33,12 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.StringFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TTLFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TTLFieldMapperTests.java index 620968ddbe8..c5d00e57c66 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/ttl/TTLMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TTLFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.ttl; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.elasticsearch.Version; @@ -35,7 +35,7 @@ import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperService.MergeReason; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -49,7 +49,7 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.notNullValue; import static org.hamcrest.Matchers.startsWith; -public class TTLMappingTests extends ESSingleNodeTestCase { +public class TTLFieldMapperTests extends ESSingleNodeTestCase { private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_3_0).build(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java index 0fd3b9aa359..f57c2810a6b 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TextFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.DocValuesType; import org.apache.lucene.index.IndexOptions; @@ -38,8 +38,9 @@ import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService.MergeReason; -import org.elasticsearch.index.mapper.core.TextFieldMapper.TextFieldType; +import org.elasticsearch.index.mapper.TextFieldMapper.TextFieldType; import org.elasticsearch.index.mapper.ParsedDocument; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.test.ESSingleNodeTestCase; import org.junit.Before; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TextFieldTypeTests.java similarity index 98% rename from core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TextFieldTypeTests.java index cde814508c5..70103111e55 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/TextFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TextFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import java.util.Arrays; @@ -28,8 +28,8 @@ import org.apache.lucene.search.FuzzyQuery; import org.apache.lucene.search.RegexpQuery; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.unit.Fuzziness; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.junit.Before; public class TextFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldMapperTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldMapperTests.java index 8f38e2be576..2b87bb10b54 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/timestamp/TimestampMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.timestamp; +package org.elasticsearch.index.mapper; import org.apache.lucene.index.IndexOptions; import org.elasticsearch.Version; @@ -43,8 +43,8 @@ import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.SourceToParse; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.mapper.MapperService.MergeReason; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; @@ -69,7 +69,7 @@ import static org.hamcrest.Matchers.startsWith; /** */ -public class TimestampMappingTests extends ESSingleNodeTestCase { +public class TimestampFieldMapperTests extends ESSingleNodeTestCase { private static final Settings BW_SETTINGS = Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_3_0).build(); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/TimestampFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldTypeTests.java similarity index 88% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/TimestampFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldTypeTests.java index deb21b434ca..c17d60c8145 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/TimestampFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TimestampFieldTypeTests.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDateFieldTypeTests; +import org.elasticsearch.index.mapper.TimestampFieldMapper; public class TimestampFieldTypeTests extends LegacyDateFieldTypeTests { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperIntegrationIT.java b/core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperIntegrationIT.java rename to core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java index 2bce69f6ecf..a84a18d2aef 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperIntegrationIT.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperTests.java index 0a27a7ebb31..67d96f988c2 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/core/TokenCountFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.core; +package org.elasticsearch.index.mapper; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CannedTokenStream; @@ -28,6 +28,7 @@ import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.TokenCountFieldMapper; import org.elasticsearch.test.ESSingleNodeTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java similarity index 96% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldMapperTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java index bd3aaf84a4f..3573cfd8b60 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; @@ -27,6 +27,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.fielddata.plain.DocValuesIndexFieldData; import org.elasticsearch.index.fielddata.plain.PagedBytesIndexFieldData; import org.elasticsearch.index.mapper.DocumentMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESSingleNodeTestCase; import org.elasticsearch.test.InternalSettingsPlugin; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldTypeTests.java similarity index 97% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/TypeFieldTypeTests.java index 8f87ca9d683..54217ea94ae 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/TypeFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldTypeTests.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; @@ -35,8 +35,8 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.apache.lucene.store.Directory; import org.apache.lucene.util.IOUtils; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.junit.Before; public class TypeFieldTypeTests extends FieldTypeTestCase { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/UidFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/UidFieldTypeTests.java similarity index 93% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/UidFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/UidFieldTypeTests.java index 7f256e822e5..4e7b2d5fa84 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/UidFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/UidFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.UidFieldMapper; public class UidFieldTypeTests extends FieldTypeTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingOnClusterIT.java b/core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingOnClusterIT.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingOnClusterIT.java rename to core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingOnClusterIT.java index afac48e2b89..9ae01b51a64 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingOnClusterIT.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingOnClusterIT.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.update; +package org.elasticsearch.index.mapper; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingTests.java b/core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java similarity index 99% rename from core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java index 86624d938b6..73cf070cba7 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/update/UpdateMappingTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/UpdateMappingTests.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.index.mapper.update; +package org.elasticsearch.index.mapper; import org.elasticsearch.Version; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/VersionFieldTypeTests.java b/core/src/test/java/org/elasticsearch/index/mapper/VersionFieldTypeTests.java similarity index 90% rename from core/src/test/java/org/elasticsearch/index/mapper/internal/VersionFieldTypeTests.java rename to core/src/test/java/org/elasticsearch/index/mapper/VersionFieldTypeTests.java index 8be4bb73d8a..8dfdb882ec8 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/VersionFieldTypeTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/VersionFieldTypeTests.java @@ -16,10 +16,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.elasticsearch.index.mapper.internal; +package org.elasticsearch.index.mapper; -import org.elasticsearch.index.mapper.FieldTypeTestCase; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.VersionFieldMapper; public class VersionFieldTypeTests extends FieldTypeTestCase { @Override diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldMapperTests.java deleted file mode 100644 index 9b5504bf70f..00000000000 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/ParentFieldMapperTests.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.elasticsearch.index.mapper.internal; - -import org.apache.lucene.index.DocValuesType; -import org.elasticsearch.Version; -import org.elasticsearch.cluster.metadata.IndexMetaData; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.ContentPath; -import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.test.ESTestCase; - -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; - -public class ParentFieldMapperTests extends ESTestCase { - - public void testPost2Dot0LazyLoading() { - ParentFieldMapper.Builder builder = new ParentFieldMapper.Builder("child"); - builder.type("parent"); - builder.eagerGlobalOrdinals(false); - - ParentFieldMapper parentFieldMapper = builder.build(new Mapper.BuilderContext(post2Dot0IndexSettings(), new ContentPath(0))); - - assertThat(parentFieldMapper.getParentJoinFieldType().name(), equalTo("_parent#child")); - assertThat(parentFieldMapper.getParentJoinFieldType().hasDocValues(), is(true)); - assertThat(parentFieldMapper.getParentJoinFieldType().docValuesType(), equalTo(DocValuesType.SORTED)); - - assertThat(parentFieldMapper.fieldType().name(), equalTo("_parent#parent")); - assertThat(parentFieldMapper.fieldType().eagerGlobalOrdinals(), equalTo(false)); - assertThat(parentFieldMapper.fieldType().hasDocValues(), is(true)); - assertThat(parentFieldMapper.fieldType().docValuesType(), equalTo(DocValuesType.SORTED)); - } - - public void testPost2Dot0EagerLoading() { - ParentFieldMapper.Builder builder = new ParentFieldMapper.Builder("child"); - builder.type("parent"); - builder.eagerGlobalOrdinals(true); - - ParentFieldMapper parentFieldMapper = builder.build(new Mapper.BuilderContext(post2Dot0IndexSettings(), new ContentPath(0))); - - assertThat(parentFieldMapper.getParentJoinFieldType().name(), equalTo("_parent#child")); - assertThat(parentFieldMapper.getParentJoinFieldType().hasDocValues(), is(true)); - assertThat(parentFieldMapper.getParentJoinFieldType().docValuesType(), equalTo(DocValuesType.SORTED)); - - assertThat(parentFieldMapper.fieldType().name(), equalTo("_parent#parent")); - assertThat(parentFieldMapper.fieldType().eagerGlobalOrdinals(), equalTo(true)); - assertThat(parentFieldMapper.fieldType().hasDocValues(), is(true)); - assertThat(parentFieldMapper.fieldType().docValuesType(), equalTo(DocValuesType.SORTED)); - } - - private static Settings post2Dot0IndexSettings() { - return Settings.builder().put(IndexMetaData.SETTING_VERSION_CREATED, Version.V_2_1_0).build(); - } - -} diff --git a/core/src/test/java/org/elasticsearch/index/mapper/package-info.java b/core/src/test/java/org/elasticsearch/index/mapper/package-info.java new file mode 100644 index 00000000000..4221a5d4a96 --- /dev/null +++ b/core/src/test/java/org/elasticsearch/index/mapper/package-info.java @@ -0,0 +1,39 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Mappings. Mappings define the way that documents should be translated to + * Lucene indices, for instance how the + * {@link org.elasticsearch.index.mapper.UidFieldMapper document identifier} + * should be indexed, whether a string field should be indexed as a + * {@link org.elasticsearch.index.mapper.TextFieldMapper text} or + * {@link org.elasticsearch.index.mapper.KeywordFieldMapper keyword} field, + * etc. This parsing is done by the + * {@link org.elasticsearch.index.mapper.DocumentParser} class which delegates + * to various {@link org.elasticsearch.index.mapper.Mapper} implementations for + * per-field handling. + *

Mappings support the addition of new fields, so that fields can be added + * to indices even though users had not thought about them at index creation + * time. However, the removal of fields is not supported, as it would allow to + * re-add a field with a different configuration under the same name, which + * Lucene cannot handle. Introduction of new fields into the mappings is handled + * by the {@link org.elasticsearch.index.mapper.MapperService} class. + */ +package org.elasticsearch.index.mapper; + diff --git a/core/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java deleted file mode 100644 index 0f9733c44bb..00000000000 --- a/core/src/test/java/org/elasticsearch/index/mapper/simple/SimpleMapperTests.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.mapper.simple; - -import org.elasticsearch.common.bytes.BytesArray; -import org.elasticsearch.common.bytes.BytesReference; -import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.IndexService; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.DocumentMapperParser; -import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.ParseContext.Document; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.object.RootObjectMapper; -import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.test.ESSingleNodeTestCase; - -import java.nio.charset.StandardCharsets; - -import static org.elasticsearch.test.StreamsUtils.copyToBytesFromClasspath; -import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath; -import static org.hamcrest.Matchers.equalTo; - -/** - * - */ -public class SimpleMapperTests extends ESSingleNodeTestCase { - public void testSimpleMapper() throws Exception { - IndexService indexService = createIndex("test"); - DocumentMapper docMapper = new DocumentMapper.Builder( - new RootObjectMapper.Builder("person") - .add(new ObjectMapper.Builder("name").add(new TextFieldMapper.Builder("first").store(true).index(false))), - indexService.mapperService()).build(indexService.mapperService()); - - BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); - Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); - - assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); - doc = docMapper.parse("test", "person", "1", json).rootDoc(); - } - - public void testParseToJsonAndParse() throws Exception { - String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); - DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); - DocumentMapper docMapper = parser.parse("person", new CompressedXContent(mapping)); - String builtMapping = docMapper.mappingSource().string(); - // reparse it - DocumentMapper builtDocMapper = parser.parse("person", new CompressedXContent(builtMapping)); - BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); - Document doc = builtDocMapper.parse("test", "person", "1", json).rootDoc(); - assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); - } - - public void testSimpleParser() throws Exception { - String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); - DocumentMapper docMapper = createIndex("test").mapperService().documentMapperParser().parse("person", new CompressedXContent(mapping)); - - assertThat((String) docMapper.meta().get("param1"), equalTo("value1")); - - BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1.json")); - Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); - assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); - } - - public void testSimpleParserNoTypeNoId() throws Exception { - String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); - DocumentMapper docMapper = createIndex("test").mapperService().documentMapperParser().parse("person", new CompressedXContent(mapping)); - BytesReference json = new BytesArray(copyToBytesFromClasspath("/org/elasticsearch/index/mapper/simple/test1-notype-noid.json")); - Document doc = docMapper.parse("test", "person", "1", json).rootDoc(); - assertThat(doc.get(docMapper.uidMapper().fieldType().name()), equalTo(Uid.createUid("person", "1"))); - assertThat(doc.get(docMapper.mappers().getMapper("name.first").fieldType().name()), equalTo("shay")); - } - - public void testAttributes() throws Exception { - String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/simple/test-mapping.json"); - DocumentMapperParser parser = createIndex("test").mapperService().documentMapperParser(); - DocumentMapper docMapper = parser.parse("person", new CompressedXContent(mapping)); - - assertThat((String) docMapper.meta().get("param1"), equalTo("value1")); - - String builtMapping = docMapper.mappingSource().string(); - DocumentMapper builtDocMapper = parser.parse("person", new CompressedXContent(builtMapping)); - assertThat((String) builtDocMapper.meta().get("param1"), equalTo("value1")); - } - - public void testNoDocumentSent() throws Exception { - IndexService indexService = createIndex("test"); - DocumentMapper docMapper = new DocumentMapper.Builder( - new RootObjectMapper.Builder("person") - .add(new ObjectMapper.Builder("name").add(new TextFieldMapper.Builder("first").store(true).index(false))), - indexService.mapperService()).build(indexService.mapperService()); - - BytesReference json = new BytesArray("".getBytes(StandardCharsets.UTF_8)); - try { - docMapper.parse("test", "person", "1", json).rootDoc(); - fail("this point is never reached"); - } catch (MapperParsingException e) { - assertThat(e.getMessage(), equalTo("failed to parse, document is empty")); - } - } - - public void testHazardousFieldNames() throws Exception { - IndexService indexService = createIndex("test"); - DocumentMapperParser mapperParser = indexService.mapperService().documentMapperParser(); - String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").startObject("properties") - .startObject("foo.bar").field("type", "text").endObject() - .endObject().endObject().endObject().string(); - try { - mapperParser.parse("type", new CompressedXContent(mapping)); - fail("Mapping parse should have failed"); - } catch (MapperParsingException e) { - assertTrue(e.getMessage(), e.getMessage().contains("cannot contain '.'")); - } - } -} diff --git a/core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java b/core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java deleted file mode 100644 index e5d6431492d..00000000000 --- a/core/src/test/java/org/elasticsearch/index/mapper/typelevels/ParseDocumentTypeLevelsTests.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.mapper.typelevels; - -import org.elasticsearch.common.compress.CompressedXContent; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.index.mapper.DocumentMapper; -import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.test.ESSingleNodeTestCase; - -import static org.hamcrest.Matchers.equalTo; - -/** - * - */ -public class ParseDocumentTypeLevelsTests extends ESSingleNodeTestCase { - public void testNoLevel() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject() - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject() - .bytes()); - - assertThat(doc.rootDoc().get("test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); - } - - public void testTypeLevel() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } - - public void testNoLevelWithFieldTypeAsValue() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject() - .field("type", "value_type") - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type"), equalTo("value_type")); - assertThat(doc.rootDoc().get("test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); - } - - public void testTypeLevelWithFieldTypeAsValue() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .field("type", "value_type") - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } - - public void testNoLevelWithFieldTypeAsObject() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject() - .startObject("type").field("type_field", "type_value").endObject() - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject() - .bytes()); - - // in this case, we analyze the type object as the actual document, and ignore the other same level fields - assertThat(doc.rootDoc().get("type.type_field"), equalTo("type_value")); - assertThat(doc.rootDoc().get("test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("test2"), equalTo("value2")); - } - - public void testTypeLevelWithFieldTypeAsObject() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .startObject("type").field("type_field", "type_value").endObject() - .field("test1", "value1") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.type.type_field"), equalTo("type_value")); - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } - - public void testNoLevelWithFieldTypeAsValueNotFirst() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .field("test1", "value1") - .field("test2", "value2") - .field("type", "value_type") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } - - public void testTypeLevelWithFieldTypeAsValueNotFirst() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .field("test1", "value1") - .field("type", "value_type") - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.type"), equalTo("value_type")); - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } - - public void testNoLevelWithFieldTypeAsObjectNotFirst() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject() - .field("test1", "value1") - .startObject("type").field("type_field", "type_value").endObject() - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject() - .bytes()); - - // when the type is not the first one, we don't confuse it... - assertThat(doc.rootDoc().get("type.type_field"), equalTo("type_value")); - assertThat(doc.rootDoc().get("test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("inner.inner_field"), equalTo("inner_value")); - } - - public void testTypeLevelWithFieldTypeAsObjectNotFirst() throws Exception { - String defaultMapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string(); - - DocumentMapper defaultMapper = createIndex("test").mapperService().documentMapperParser().parse("type", new CompressedXContent(defaultMapping)); - - ParsedDocument doc = defaultMapper.parse("test", "type", "1", XContentFactory.jsonBuilder() - .startObject().startObject("type") - .field("test1", "value1") - .startObject("type").field("type_field", "type_value").endObject() - .field("test2", "value2") - .startObject("inner").field("inner_field", "inner_value").endObject() - .endObject().endObject() - .bytes()); - - assertThat(doc.rootDoc().get("type.type.type_field"), equalTo("type_value")); - assertThat(doc.rootDoc().get("type.test1"), equalTo("value1")); - assertThat(doc.rootDoc().get("type.test2"), equalTo("value2")); - assertThat(doc.rootDoc().get("type.inner.inner_field"), equalTo("inner_value")); - } -} diff --git a/core/src/test/java/org/elasticsearch/index/query/GeohashCellQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/GeohashCellQueryBuilderTests.java index dbccd700165..e9e4a71190d 100644 --- a/core/src/test/java/org/elasticsearch/index/query/GeohashCellQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/GeohashCellQueryBuilderTests.java @@ -26,8 +26,8 @@ import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; import org.elasticsearch.common.geo.GeoPoint; import org.elasticsearch.common.unit.DistanceUnit; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.query.GeohashCellQuery.Builder; import org.elasticsearch.test.AbstractQueryTestCase; import org.elasticsearch.test.geo.RandomShapeGenerator; diff --git a/core/src/test/java/org/elasticsearch/index/query/HasChildQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/HasChildQueryBuilderTests.java index 2d85bffa9a0..3ec16948450 100644 --- a/core/src/test/java/org/elasticsearch/index/query/HasChildQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/HasChildQueryBuilderTests.java @@ -38,9 +38,9 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.mapper.MapperService; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.search.fetch.innerhits.InnerHitsContext; import org.elasticsearch.search.internal.SearchContext; diff --git a/core/src/test/java/org/elasticsearch/index/query/ParentIdQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/ParentIdQueryBuilderTests.java index 89d0829e012..750d9ce319f 100644 --- a/core/src/test/java/org/elasticsearch/index/query/ParentIdQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/ParentIdQueryBuilderTests.java @@ -27,7 +27,7 @@ import org.apache.lucene.search.TermQuery; import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest; import org.elasticsearch.common.compress.CompressedXContent; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.test.AbstractQueryTestCase; import org.hamcrest.Matchers; diff --git a/core/src/test/java/org/elasticsearch/index/query/QueryShardContextTests.java b/core/src/test/java/org/elasticsearch/index/query/QueryShardContextTests.java index e1a41df4da5..3b3bdf31b75 100644 --- a/core/src/test/java/org/elasticsearch/index/query/QueryShardContextTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/QueryShardContextTests.java @@ -24,7 +24,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.test.ESTestCase; import static org.hamcrest.Matchers.equalTo; diff --git a/core/src/test/java/org/elasticsearch/index/query/TypeQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/TypeQueryBuilderTests.java index 5e02aba6ec6..bcae7e39948 100644 --- a/core/src/test/java/org/elasticsearch/index/query/TypeQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/TypeQueryBuilderTests.java @@ -22,7 +22,7 @@ package org.elasticsearch.index.query; import org.apache.lucene.search.MatchNoDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.test.AbstractQueryTestCase; import java.io.IOException; diff --git a/core/src/test/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java b/core/src/test/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java index 729bc549af4..4bfe0885506 100644 --- a/core/src/test/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java +++ b/core/src/test/java/org/elasticsearch/index/replication/ESIndexLevelReplicationTestCase.java @@ -60,7 +60,7 @@ import org.elasticsearch.index.cache.query.DisabledQueryCache; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.IndexEventListener; import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.IndexShardState; diff --git a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 01eeb1edfe0..d10deaa90f6 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -94,7 +94,7 @@ import org.elasticsearch.index.mapper.Mapping; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.ParsedDocument; import org.elasticsearch.index.mapper.Uid; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.snapshots.IndexShardSnapshotStatus; import org.elasticsearch.index.store.Store; import org.elasticsearch.index.translog.Translog; diff --git a/core/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java b/core/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java index 5b896190d09..20fd02b5163 100644 --- a/core/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java +++ b/core/src/test/java/org/elasticsearch/index/shard/RefreshListenersTests.java @@ -47,7 +47,7 @@ import org.elasticsearch.index.engine.InternalEngineTests.TranslogHandler; import org.elasticsearch.index.fieldvisitor.SingleFieldsVisitor; import org.elasticsearch.index.mapper.ParseContext.Document; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.store.DirectoryService; import org.elasticsearch.index.store.Store; import org.elasticsearch.index.translog.TranslogConfig; diff --git a/core/src/test/java/org/elasticsearch/indices/IndicesModuleTests.java b/core/src/test/java/org/elasticsearch/indices/IndicesModuleTests.java index 2c27e92635f..04b60b80c0c 100644 --- a/core/src/test/java/org/elasticsearch/indices/IndicesModuleTests.java +++ b/core/src/test/java/org/elasticsearch/indices/IndicesModuleTests.java @@ -27,13 +27,13 @@ import java.util.stream.Collectors; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.MetadataFieldMapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; -import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.indices.mapper.MapperRegistry; import org.elasticsearch.plugins.MapperPlugin; import org.elasticsearch.test.ESTestCase; diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java index d56a4b7f604..66dd387623a 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java @@ -23,7 +23,7 @@ import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.joda.DateMathParser; import org.elasticsearch.common.joda.Joda; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.mapper.core.DateFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java index 158cbe9be9d..9be3a83bbc9 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/DateHistogramOffsetIT.java @@ -20,7 +20,7 @@ package org.elasticsearch.search.aggregations.bucket; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.index.mapper.core.DateFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsIT.java index ba3b9380504..8ccccf3f33a 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/StringTermsIT.java @@ -25,7 +25,7 @@ import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.Strings; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; +import org.elasticsearch.index.mapper.IndexFieldMapper; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.script.Script; diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java index 272aa70d48b..a3bb846c3e1 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/NestedAggregatorTests.java @@ -38,8 +38,8 @@ import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.search.aggregations.Aggregator; import org.elasticsearch.search.aggregations.AggregatorFactories; diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java index e156d5586f7..3d4394a0f3b 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/pipeline/DateDerivativeIT.java @@ -21,7 +21,7 @@ package org.elasticsearch.search.aggregations.pipeline; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; -import org.elasticsearch.index.mapper.core.DateFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.search.aggregations.bucket.histogram.DateHistogramInterval; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram; import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket; diff --git a/core/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java b/core/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java index a9f73935504..f7e1da896a8 100644 --- a/core/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java +++ b/core/src/test/java/org/elasticsearch/search/fields/SearchFieldsIT.java @@ -30,7 +30,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.index.fielddata.ScriptDocValues; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestStatus; diff --git a/core/src/test/java/org/elasticsearch/search/geo/GeoShapeIntegrationIT.java b/core/src/test/java/org/elasticsearch/search/geo/GeoShapeIntegrationIT.java index 4294547e7fc..aaff5b5abdc 100644 --- a/core/src/test/java/org/elasticsearch/search/geo/GeoShapeIntegrationIT.java +++ b/core/src/test/java/org/elasticsearch/search/geo/GeoShapeIntegrationIT.java @@ -23,8 +23,8 @@ import org.elasticsearch.cluster.routing.IndexShardRoutingTable; import org.elasticsearch.common.geo.builders.ShapeBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; +import org.elasticsearch.index.mapper.GeoShapeFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.GeoShapeFieldMapper; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESIntegTestCase; diff --git a/core/src/test/java/org/elasticsearch/search/highlight/HighlightBuilderTests.java b/core/src/test/java/org/elasticsearch/search/highlight/HighlightBuilderTests.java index d0387dc1e1c..54e33aad581 100644 --- a/core/src/test/java/org/elasticsearch/search/highlight/HighlightBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/search/highlight/HighlightBuilderTests.java @@ -40,7 +40,7 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/core/src/test/java/org/elasticsearch/search/internal/DefaultSearchContextTests.java b/core/src/test/java/org/elasticsearch/search/internal/DefaultSearchContextTests.java index d8fe2308bc7..9ab5af9f393 100644 --- a/core/src/test/java/org/elasticsearch/search/internal/DefaultSearchContextTests.java +++ b/core/src/test/java/org/elasticsearch/search/internal/DefaultSearchContextTests.java @@ -25,7 +25,7 @@ import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.lucene.search.Queries; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.test.ESTestCase; import static org.apache.lucene.search.BooleanClause.Occur.FILTER; diff --git a/core/src/test/java/org/elasticsearch/search/query/ExistsIT.java b/core/src/test/java/org/elasticsearch/search/query/ExistsIT.java index 8024112289e..978eff3674d 100644 --- a/core/src/test/java/org/elasticsearch/search/query/ExistsIT.java +++ b/core/src/test/java/org/elasticsearch/search/query/ExistsIT.java @@ -24,7 +24,7 @@ import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.json.JsonXContent; -import org.elasticsearch.index.mapper.internal.FieldNamesFieldMapper; +import org.elasticsearch.index.mapper.FieldNamesFieldMapper; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.search.SearchHit; import org.elasticsearch.test.ESIntegTestCase; diff --git a/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java b/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java index bd90f82cd92..1af4a2b1788 100644 --- a/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/search/rescore/QueryRescoreBuilderTests.java @@ -40,7 +40,7 @@ import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryParseContext; diff --git a/core/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java b/core/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java index 145fcdc188a..695c926976b 100644 --- a/core/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/search/slice/SliceBuilderTests.java @@ -42,7 +42,7 @@ import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.index.fielddata.IndexNumericFieldData; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.internal.UidFieldMapper; +import org.elasticsearch.index.mapper.UidFieldMapper; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryParseContext; import org.elasticsearch.index.query.QueryParser; diff --git a/core/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java b/core/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java index 1171f774400..3ea9eac5cca 100644 --- a/core/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java +++ b/core/src/test/java/org/elasticsearch/search/sort/AbstractSortTestCase.java @@ -41,10 +41,10 @@ import org.elasticsearch.index.cache.bitset.BitsetFilterCache; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.mapper.ContentPath; import org.elasticsearch.index.mapper.MappedFieldType; +import org.elasticsearch.index.mapper.ObjectMapper; +import org.elasticsearch.index.mapper.LegacyDoubleFieldMapper.DoubleFieldType; import org.elasticsearch.index.mapper.Mapper.BuilderContext; -import org.elasticsearch.index.mapper.core.LegacyDoubleFieldMapper.DoubleFieldType; -import org.elasticsearch.index.mapper.object.ObjectMapper; -import org.elasticsearch.index.mapper.object.ObjectMapper.Nested; +import org.elasticsearch.index.mapper.ObjectMapper.Nested; import org.elasticsearch.index.query.IdsQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; diff --git a/core/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java b/core/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java index 385003b7995..4dd14cc523f 100644 --- a/core/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/search/sort/GeoDistanceSortBuilderTests.java @@ -33,8 +33,8 @@ import org.elasticsearch.common.unit.DistanceUnit; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.mapper.GeoPointFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; -import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper; import org.elasticsearch.index.query.GeoValidationMethod; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.QueryParseContext; diff --git a/core/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestSearch2xIT.java b/core/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestSearch2xIT.java index b03c380b266..0e18561f2be 100644 --- a/core/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestSearch2xIT.java +++ b/core/src/test/java/org/elasticsearch/search/suggest/CompletionSuggestSearch2xIT.java @@ -36,9 +36,9 @@ import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.XContentBuilder; +import org.elasticsearch.index.mapper.CompletionFieldMapper2x; import org.elasticsearch.index.mapper.MapperException; import org.elasticsearch.index.mapper.MapperParsingException; -import org.elasticsearch.index.mapper.core.CompletionFieldMapper2x; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.search.aggregations.AggregationBuilders; import org.elasticsearch.search.aggregations.Aggregator.SubAggCollectionMode; diff --git a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java index 72a5169593a..36ce55067f4 100644 --- a/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java +++ b/modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngineService.java @@ -32,11 +32,11 @@ import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.fielddata.IndexNumericFieldData; +import org.elasticsearch.index.mapper.BaseGeoPointFieldMapper; +import org.elasticsearch.index.mapper.DateFieldMapper; +import org.elasticsearch.index.mapper.LegacyDateFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.LegacyDateFieldMapper; -import org.elasticsearch.index.mapper.geo.BaseGeoPointFieldMapper; import org.elasticsearch.script.ClassPermission; import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ExecutableScript; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java index 3acb5c1f68c..3d5965b3586 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateQueryBuilder.java @@ -64,8 +64,8 @@ import org.elasticsearch.index.mapper.DocumentMapperForType; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.ParsedDocument; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.index.query.AbstractQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryParseContext; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java index 4cd3bdabbd8..32633775167 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorFieldMapper.java @@ -43,13 +43,13 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentLocation; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.index.mapper.BinaryFieldMapper; import org.elasticsearch.index.mapper.FieldMapper; +import org.elasticsearch.index.mapper.KeywordFieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.BinaryFieldMapper; -import org.elasticsearch.index.mapper.core.KeywordFieldMapper; import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoostingQueryBuilder; import org.elasticsearch.index.query.ConstantScoreQueryBuilder; diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollAction.java index 4b87df46312..73c05678651 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollAction.java @@ -29,15 +29,15 @@ import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.SourceFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; +import org.elasticsearch.index.mapper.IndexFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.script.CompiledScript; import org.elasticsearch.script.ExecutableScript; import org.elasticsearch.script.Script; diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java index 5e694e2cf26..030753e9414 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ClientScrollableHitSource.java @@ -35,10 +35,10 @@ import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.SearchHitField; import org.elasticsearch.threadpool.ThreadPool; diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportReindexAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportReindexAction.java index 2be3261b4af..57d29283bb3 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportReindexAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportReindexAction.java @@ -53,8 +53,8 @@ import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.http.HttpInfo; import org.elasticsearch.http.HttpServer; import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.VersionFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.VersionFieldMapper; import org.elasticsearch.index.reindex.ScrollableHitSource.SearchFailure; import org.elasticsearch.index.reindex.remote.RemoteInfo; import org.elasticsearch.index.reindex.remote.RemoteScrollableHitSource; diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportUpdateByQueryAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportUpdateByQueryAction.java index 7c9b8238ca2..79c013482e7 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportUpdateByQueryAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/TransportUpdateByQueryAction.java @@ -32,13 +32,13 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.VersionType; -import org.elasticsearch.index.mapper.internal.IdFieldMapper; -import org.elasticsearch.index.mapper.internal.IndexFieldMapper; -import org.elasticsearch.index.mapper.internal.ParentFieldMapper; -import org.elasticsearch.index.mapper.internal.RoutingFieldMapper; -import org.elasticsearch.index.mapper.internal.TTLFieldMapper; -import org.elasticsearch.index.mapper.internal.TimestampFieldMapper; -import org.elasticsearch.index.mapper.internal.TypeFieldMapper; +import org.elasticsearch.index.mapper.IdFieldMapper; +import org.elasticsearch.index.mapper.IndexFieldMapper; +import org.elasticsearch.index.mapper.ParentFieldMapper; +import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.TTLFieldMapper; +import org.elasticsearch.index.mapper.TimestampFieldMapper; +import org.elasticsearch.index.mapper.TypeFieldMapper; import org.elasticsearch.script.Script; import org.elasticsearch.script.ScriptService; import org.elasticsearch.tasks.Task; diff --git a/plugins/mapper-attachments/src/main/java/org/elasticsearch/mapper/attachments/AttachmentMapper.java b/plugins/mapper-attachments/src/main/java/org/elasticsearch/mapper/attachments/AttachmentMapper.java index 06e51686823..a7d8228397e 100644 --- a/plugins/mapper-attachments/src/main/java/org/elasticsearch/mapper/attachments/AttachmentMapper.java +++ b/plugins/mapper-attachments/src/main/java/org/elasticsearch/mapper/attachments/AttachmentMapper.java @@ -33,16 +33,16 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.index.mapper.DocumentMapperParser; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; +import org.elasticsearch.index.mapper.NumberFieldMapper; import org.elasticsearch.index.mapper.ParseContext; -import org.elasticsearch.index.mapper.core.DateFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper; -import org.elasticsearch.index.mapper.core.NumberFieldMapper.NumberType; -import org.elasticsearch.index.mapper.core.TextFieldMapper; +import org.elasticsearch.index.mapper.TextFieldMapper; +import org.elasticsearch.index.mapper.NumberFieldMapper.NumberType; import org.elasticsearch.index.query.QueryShardContext; import org.elasticsearch.index.query.QueryShardException; @@ -52,7 +52,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import static org.elasticsearch.index.mapper.core.TypeParsers.parseMultiField; +import static org.elasticsearch.index.mapper.TypeParsers.parseMultiField; /** *

diff --git a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/DateAttachmentMapperTests.java b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/DateAttachmentMapperTests.java
index a384eb9f04e..635c9bee859 100644
--- a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/DateAttachmentMapperTests.java
+++ b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/DateAttachmentMapperTests.java
@@ -24,7 +24,7 @@ import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.MapperTestUtils;
 import org.elasticsearch.index.mapper.DocumentMapper;
 import org.elasticsearch.index.mapper.DocumentMapperParser;
-import org.elasticsearch.index.mapper.core.TextFieldMapper;
+import org.elasticsearch.index.mapper.TextFieldMapper;
 import org.junit.Before;
 
 import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath;
diff --git a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/LanguageDetectionAttachmentMapperTests.java b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/LanguageDetectionAttachmentMapperTests.java
index 7451524364b..8c09c78740a 100644
--- a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/LanguageDetectionAttachmentMapperTests.java
+++ b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/LanguageDetectionAttachmentMapperTests.java
@@ -26,8 +26,8 @@ import org.elasticsearch.index.MapperTestUtils;
 import org.elasticsearch.index.mapper.DocumentMapper;
 import org.elasticsearch.index.mapper.DocumentMapperParser;
 import org.elasticsearch.index.mapper.ParseContext;
-import org.elasticsearch.index.mapper.core.StringFieldMapper;
-import org.elasticsearch.index.mapper.core.TextFieldMapper;
+import org.elasticsearch.index.mapper.StringFieldMapper;
+import org.elasticsearch.index.mapper.TextFieldMapper;
 import org.junit.Before;
 
 import java.io.IOException;
diff --git a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MultifieldAttachmentMapperTests.java b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MultifieldAttachmentMapperTests.java
index a5f87f57ac0..84284aa8128 100644
--- a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MultifieldAttachmentMapperTests.java
+++ b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/MultifieldAttachmentMapperTests.java
@@ -23,12 +23,12 @@ import org.elasticsearch.common.compress.CompressedXContent;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentFactory;
 import org.elasticsearch.index.MapperTestUtils;
+import org.elasticsearch.index.mapper.DateFieldMapper;
 import org.elasticsearch.index.mapper.DocumentMapper;
 import org.elasticsearch.index.mapper.DocumentMapperParser;
 import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.index.mapper.ParsedDocument;
-import org.elasticsearch.index.mapper.core.DateFieldMapper;
-import org.elasticsearch.index.mapper.core.TextFieldMapper;
+import org.elasticsearch.index.mapper.TextFieldMapper;
 import org.junit.Before;
 
 import java.nio.charset.StandardCharsets;
diff --git a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java
index 0c43efb8ecd..a31692a6bac 100644
--- a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java
+++ b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java
@@ -40,7 +40,7 @@ import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.Mapper;
 import org.elasticsearch.index.mapper.MapperParsingException;
 import org.elasticsearch.index.mapper.ParseContext;
-import org.elasticsearch.index.mapper.core.TypeParsers;
+import org.elasticsearch.index.mapper.TypeParsers;
 import org.elasticsearch.index.query.QueryShardContext;
 import org.elasticsearch.index.query.QueryShardException;
 
diff --git a/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java b/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java
index c9c8972c62d..a9fb9049b04 100644
--- a/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java
+++ b/plugins/mapper-size/src/main/java/org/elasticsearch/index/mapper/size/SizeFieldMapper.java
@@ -25,14 +25,14 @@ import org.elasticsearch.Version;
 import org.elasticsearch.common.lucene.Lucene;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.elasticsearch.index.mapper.EnabledAttributeMapper;
+import org.elasticsearch.index.mapper.LegacyIntegerFieldMapper;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.Mapper;
 import org.elasticsearch.index.mapper.MapperParsingException;
 import org.elasticsearch.index.mapper.MetadataFieldMapper;
+import org.elasticsearch.index.mapper.NumberFieldMapper;
 import org.elasticsearch.index.mapper.ParseContext;
-import org.elasticsearch.index.mapper.core.LegacyIntegerFieldMapper;
-import org.elasticsearch.index.mapper.core.NumberFieldMapper;
-import org.elasticsearch.index.mapper.internal.EnabledAttributeMapper;
 
 import java.io.IOException;
 import java.util.Iterator;
diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java
index 8cc01aba4bb..5d832aa1518 100644
--- a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java
+++ b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java
@@ -29,12 +29,12 @@ import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentFactory;
 import org.elasticsearch.index.IndexService;
 import org.elasticsearch.index.mapper.MapperService;
+import org.elasticsearch.index.mapper.NumberFieldMapper;
 import org.elasticsearch.index.mapper.DocumentMapper;
+import org.elasticsearch.index.mapper.LegacyNumberFieldMapper;
 import org.elasticsearch.index.mapper.ParsedDocument;
 import org.elasticsearch.index.mapper.SourceToParse;
 import org.elasticsearch.index.mapper.MappedFieldType;
-import org.elasticsearch.index.mapper.core.LegacyNumberFieldMapper;
-import org.elasticsearch.index.mapper.core.NumberFieldMapper;
 import org.elasticsearch.plugin.mapper.MapperSizePlugin;
 import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.test.ESSingleNodeTestCase;
diff --git a/test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java b/test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java
index 97240bd9e5e..6b123b73c3c 100644
--- a/test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java
+++ b/test/framework/src/main/java/org/elasticsearch/test/TestSearchContext.java
@@ -37,7 +37,7 @@ import org.elasticsearch.index.engine.Engine;
 import org.elasticsearch.index.fielddata.IndexFieldDataService;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MapperService;
-import org.elasticsearch.index.mapper.object.ObjectMapper;
+import org.elasticsearch.index.mapper.ObjectMapper;
 import org.elasticsearch.index.query.ParsedQuery;
 import org.elasticsearch.index.query.QueryShardContext;
 import org.elasticsearch.index.shard.IndexShard;