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:
parent
d272646a55
commit
b1161cba35
|
@ -796,7 +796,7 @@ final class DefaultSearchContext extends SearchContext {
|
|||
}
|
||||
|
||||
@Override
|
||||
public MappedFieldType smartNameFieldType(String name) {
|
||||
public MappedFieldType fieldType(String name) {
|
||||
return mapperService().fieldType(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue