Rename SearchContext#smartNameFieldType. (#58203)

The concept of a 'smart name' doesn't make sense now that there are no mapping
types.
This commit is contained in:
Julie Tibshirani 2020-06-17 10:36:31 -07:00
parent d272646a55
commit b1161cba35
6 changed files with 8 additions and 8 deletions

View File

@ -796,7 +796,7 @@ final class DefaultSearchContext extends SearchContext {
}
@Override
public MappedFieldType smartNameFieldType(String name) {
public MappedFieldType fieldType(String name) {
return mapperService().fieldType(name);
}

View File

@ -120,7 +120,7 @@ public class FetchPhase implements SearchPhase {
Collection<String> fieldNames = context.mapperService().simpleMatchToFullName(fieldNameOrPattern);
for (String fieldName : fieldNames) {
MappedFieldType fieldType = context.smartNameFieldType(fieldName);
MappedFieldType fieldType = context.fieldType(fieldName);
if (fieldType == null) {
// Only fail if we know it is a object field, missing paths / fields shouldn't fail.
if (context.getObjectMapper(fieldName) != null) {

View File

@ -497,8 +497,8 @@ public abstract class FilteredSearchContext extends SearchContext {
}
@Override
public MappedFieldType smartNameFieldType(String name) {
return in.smartNameFieldType(name);
public MappedFieldType fieldType(String name) {
return in.fieldType(name);
}
@Override

View File

@ -388,9 +388,9 @@ public abstract class SearchContext extends AbstractRefCounted implements Releas
}
/**
* Looks up the given field, but does not restrict to fields in the types set on this context.
* Given the full name of a field, returns its {@link MappedFieldType}.
*/
public abstract MappedFieldType smartNameFieldType(String name);
public abstract MappedFieldType fieldType(String name);
public abstract ObjectMapper getObjectMapper(String name);

View File

@ -181,7 +181,7 @@ public abstract class AggregatorTestCase extends ESTestCase {
MappedFieldType fieldType = entry.getValue();
when(mapperService.fieldType(fieldName)).thenReturn(fieldType);
when(searchContext.smartNameFieldType(fieldName)).thenReturn(fieldType);
when(searchContext.fieldType(fieldName)).thenReturn(fieldType);
}
}

View File

@ -578,7 +578,7 @@ public class TestSearchContext extends SearchContext {
}
@Override
public MappedFieldType smartNameFieldType(String name) {
public MappedFieldType fieldType(String name) {
if (mapperService() != null) {
return mapperService().fieldType(name);
}