From ee00b06cad0705335361482dbc558cc0b082060c Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Wed, 3 Apr 2024 10:16:26 +0200 Subject: [PATCH] iter --- .../elasticsearch/search/fetch/subphase/FetchFieldsPhase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java index e759d13264507..1244772c36b3c 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchFieldsPhase.java @@ -13,6 +13,7 @@ import org.elasticsearch.index.mapper.IgnoredFieldMapper; import org.elasticsearch.index.mapper.LegacyTypeFieldMapper; import org.elasticsearch.index.mapper.RoutingFieldMapper; +import org.elasticsearch.index.mapper.SourceFieldMapper; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.fetch.FetchContext; import org.elasticsearch.search.fetch.FetchSubPhase; @@ -63,6 +64,7 @@ public FetchSubPhaseProcessor getProcessor(FetchContext fetchContext) { } else { fields = new ArrayList<>(METADATA_FIELDS); for (String fieldName : storedFieldsContext.fieldNames()) { + if (fieldName.equals(SourceFieldMapper.NAME) == false) fields.add(new FieldAndFormat(fieldName, null)); } }