Skip to content

Commit 6bb086b

Browse files
committed
feedback
1 parent afc4aad commit 6bb086b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,13 @@ Set<String> getMatchingFieldNames(String pattern) {
223223
if (dynamicFieldTypes.isEmpty() == false) {
224224
// check if any dynamic field roots match the pattern
225225
String[] subparts = pattern.split("\\.", 2);
226-
if (subparts.length > 1 && dynamicFieldTypes.containsKey(subparts[0])) {
226+
if (subparts.length > 1) {
227227
DynamicFieldType dft = dynamicFieldTypes.get(subparts[0]);
228-
Set<String> childNames = dft.getChildFieldNames(subparts[1]);
229-
if (childNames != null) {
230-
return childNames.stream().map(childName -> subparts[0] + "." + childName).collect(Collectors.toUnmodifiableSet());
228+
if (dft != null) {
229+
Set<String> childNames = dft.getChildFieldNames(subparts[1]);
230+
if (childNames != null) {
231+
return childNames.stream().map(childName -> subparts[0] + "." + childName).collect(Collectors.toUnmodifiableSet());
232+
}
231233
}
232234
}
233235
}

0 commit comments

Comments
 (0)