Skip to content

Commit 9bb7d21

Browse files
authored
Remove the AllFieldMapper from master (#51106)
We have a few references left in master to the AllFieldMapper, which was deprecated in the 6x line and only kept in 7x for backwards compatibility. These references can be removed entirely in master.
1 parent 0f7b97a commit 9bb7d21

File tree

3 files changed

+1
-189
lines changed

3 files changed

+1
-189
lines changed

server/src/main/java/org/elasticsearch/index/mapper/AllFieldMapper.java

Lines changed: 0 additions & 175 deletions
This file was deleted.

server/src/main/java/org/elasticsearch/indices/mapper/MapperRegistry.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.elasticsearch.indices.mapper;
2121

2222
import org.elasticsearch.Version;
23-
import org.elasticsearch.index.mapper.AllFieldMapper;
2423
import org.elasticsearch.index.mapper.Mapper;
2524
import org.elasticsearch.index.mapper.MetadataFieldMapper;
2625
import org.elasticsearch.plugins.MapperPlugin;
@@ -38,19 +37,13 @@ public final class MapperRegistry {
3837

3938
private final Map<String, Mapper.TypeParser> mapperParsers;
4039
private final Map<String, MetadataFieldMapper.TypeParser> metadataMapperParsers;
41-
private final Map<String, MetadataFieldMapper.TypeParser> metadataMapperParsers6x;
4240
private final Function<String, Predicate<String>> fieldFilter;
4341

4442

4543
public MapperRegistry(Map<String, Mapper.TypeParser> mapperParsers,
4644
Map<String, MetadataFieldMapper.TypeParser> metadataMapperParsers, Function<String, Predicate<String>> fieldFilter) {
4745
this.mapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(mapperParsers));
4846
this.metadataMapperParsers = Collections.unmodifiableMap(new LinkedHashMap<>(metadataMapperParsers));
49-
// add the _all field mapper for indices created in 6x
50-
Map<String, MetadataFieldMapper.TypeParser> metadata6x = new LinkedHashMap<>();
51-
metadata6x.put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser());
52-
metadata6x.putAll(metadataMapperParsers);
53-
this.metadataMapperParsers6x = Collections.unmodifiableMap(metadata6x);
5447
this.fieldFilter = fieldFilter;
5548
}
5649

@@ -67,7 +60,7 @@ public Map<String, Mapper.TypeParser> getMapperParsers() {
6760
* returned map uses the name of the field as a key.
6861
*/
6962
public Map<String, MetadataFieldMapper.TypeParser> getMetadataMapperParsers(Version indexCreatedVersion) {
70-
return indexCreatedVersion.onOrAfter(Version.V_7_0_0) ? metadataMapperParsers : metadataMapperParsers6x;
63+
return metadataMapperParsers;
7164
}
7265

7366
/**

server/src/test/java/org/elasticsearch/indices/IndicesModuleTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.elasticsearch.indices;
2121

2222
import org.elasticsearch.Version;
23-
import org.elasticsearch.index.mapper.AllFieldMapper;
2423
import org.elasticsearch.index.mapper.FieldNamesFieldMapper;
2524
import org.elasticsearch.index.mapper.IdFieldMapper;
2625
import org.elasticsearch.index.mapper.IgnoredFieldMapper;
@@ -90,11 +89,6 @@ public Map<String, MetadataFieldMapper.TypeParser> getMetadataMappers() {
9089
RoutingFieldMapper.NAME, IndexFieldMapper.NAME, SourceFieldMapper.NAME, TypeFieldMapper.NAME,
9190
VersionFieldMapper.NAME, SeqNoFieldMapper.NAME, FieldNamesFieldMapper.NAME};
9291

93-
private static String[] EXPECTED_METADATA_FIELDS_6x = new String[]{AllFieldMapper.NAME, IgnoredFieldMapper.NAME,
94-
IdFieldMapper.NAME, RoutingFieldMapper.NAME, IndexFieldMapper.NAME, SourceFieldMapper.NAME, TypeFieldMapper.NAME,
95-
VersionFieldMapper.NAME, SeqNoFieldMapper.NAME, FieldNamesFieldMapper.NAME};
96-
97-
9892
public void testBuiltinMappers() {
9993
IndicesModule module = new IndicesModule(Collections.emptyList());
10094
{

0 commit comments

Comments
 (0)