From ab96ec16f4a5ff85fb066c8d3458b838314762a0 Mon Sep 17 00:00:00 2001 From: Salvatore Campagna Date: Tue, 2 Apr 2024 10:06:29 +0200 Subject: [PATCH] fix: null check not required after #106862 --- .../elasticsearch/search/fetch/subphase/FieldFetcher.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldFetcher.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldFetcher.java index b8848b2883593..4f1d24e6d6d9c 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldFetcher.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FieldFetcher.java @@ -73,12 +73,6 @@ public static FieldFetcher create( for (String field : context.getMatchingFieldNames(fieldPattern)) { MappedFieldType ft = context.getFieldType(field); - // NOTE: fields that are not allowed for security reasons behave as if they are unmapped. - // In that case we do not expect to return values for those fields so the ValueFetcher - // is not needed. - if (ft == null) { - continue; - } if ("_size".equals(field) && includeSizeMetadataField == false) { continue; }