Skip to content

Commit

Permalink
Modify to invoke QueryShardContext.fieldMapper() method to apply allo…
Browse files Browse the repository at this point in the history
…wUnmappedFields and mapUnmappedFieldAsString settings

Signed-off-by: imyp92 <[email protected]>
  • Loading branch information
tokki92 authored and imyp92 committed May 25, 2024
1 parent 1c0a274 commit 9602278
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,20 +230,16 @@ private static Collection<String> getMappedField(QueryShardContext context, Stri
if (context.getObjectMapper(fieldPattern) != null) {
// the _field_names field also indexes objects, so we don't have to
// do any more work to support exists queries on whole objects
fields = Collections.singleton(fieldPattern);
return Collections.singleton(fieldPattern);
} else {
fields = context.simpleMatchToIndexNames(fieldPattern);
}

if (fields.size() == 1) {
String field = fields.iterator().next();
MappedFieldType fieldType = context.getMapperService().fieldType(field);
MappedFieldType fieldType = context.fieldMapper(field);
if (fieldType == null) {
// The field does not exist as a leaf but could be an object so
// check for an object mapper
if (context.getObjectMapper(field) == null) {
return Collections.emptySet();
}
return Collections.emptySet();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static Map<String, Float> resolveMappingField(
fieldName = fieldName + fieldSuffix;
}

MappedFieldType fieldType = context.getMapperService().fieldType(fieldName);
MappedFieldType fieldType = context.fieldMapper(fieldName);
if (fieldType == null) {
continue;
}
Expand Down

0 comments on commit 9602278

Please sign in to comment.