Browse Source

Remove MapperService.simpleMatchToFullname() (#72244)

This just delegates to mappingLookup().simpleMatchToFullName(), and
is only called in two places.
Alan Woodward 4 years ago
parent
commit
2560798488

+ 0 - 9
server/src/main/java/org/elasticsearch/index/mapper/MapperService.java

@@ -45,7 +45,6 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import java.util.function.BooleanSupplier;
 import java.util.function.Function;
 import java.util.function.Supplier;
@@ -365,14 +364,6 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
         return mappingLookup().fieldTypesLookup().get(fullName);
     }
 
-    /**
-     * Returns all the fields that match the given pattern. If the pattern is prefixed with a type
-     * then the fields will be returned with a type prefix.
-     */
-    public Set<String> simpleMatchToFullName(String pattern) {
-        return mappingLookup().simpleMatchToFullName(pattern);
-    }
-
     /**
      * {@code volatile} read a (mostly) immutable snapshot current mapping.
      */

+ 1 - 1
server/src/main/java/org/elasticsearch/index/termvectors/TermVectorsService.java

@@ -152,7 +152,7 @@ public class TermVectorsService  {
     private static void handleFieldWildcards(IndexShard indexShard, TermVectorsRequest request) {
         Set<String> fieldNames = new HashSet<>();
         for (String pattern : request.selectedFields()) {
-            fieldNames.addAll(indexShard.mapperService().simpleMatchToFullName(pattern));
+            fieldNames.addAll(indexShard.mapperService().mappingLookup().simpleMatchToFullName(pattern));
         }
         request.selectedFields(fieldNames.toArray(Strings.EMPTY_ARRAY));
     }

+ 1 - 1
test/framework/src/main/java/org/elasticsearch/index/mapper/MapperServiceTestCase.java

@@ -519,7 +519,7 @@ public abstract class MapperServiceTestCase extends ESTestCase {
         when(searchExecutionContext.getObjectMapper(anyString())).thenAnswer(
             inv -> mapperService.mappingLookup().objectMappers().get(inv.getArguments()[0].toString()));
         when(searchExecutionContext.simpleMatchToIndexNames(anyObject())).thenAnswer(
-            inv -> mapperService.simpleMatchToFullName(inv.getArguments()[0].toString())
+            inv -> mapperService.mappingLookup().simpleMatchToFullName(inv.getArguments()[0].toString())
         );
         when(searchExecutionContext.allowExpensiveQueries()).thenReturn(true);
         when(searchExecutionContext.lookup()).thenReturn(new SearchLookup(mapperService::fieldType, (ft, s) -> {