diff --git a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java index bba614dce78a5..c773617569cc9 100644 --- a/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java +++ b/server/src/main/java/org/elasticsearch/search/fetch/subphase/FetchSourceContext.java @@ -15,6 +15,7 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.core.Booleans; import org.elasticsearch.core.Nullable; +import org.elasticsearch.index.mapper.SemanticTextInferenceFieldMapper; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.search.lookup.SourceFilter; import org.elasticsearch.xcontent.ParseField; @@ -124,7 +125,8 @@ public static FetchSourceContext parseFromRestRequest(RestRequest request) { if (fetchSource != null || sourceIncludes != null || sourceExcludes != null) { return FetchSourceContext.of(fetchSource == null || fetchSource, sourceIncludes, sourceExcludes); } - return null; + + return FetchSourceContext.of(true, null, new String[]{SemanticTextInferenceFieldMapper.FIELD_NAME}); } public static FetchSourceContext fromXContent(XContentParser parser) throws IOException {