From 6823d50840c7d6cd0bb886cd7fcea68b3cbf0f7e Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 16 Feb 2012 21:21:12 +0200 Subject: [PATCH] when asking for _source with script fields, the _source is not returned. --- src/main/java/org/elasticsearch/search/fetch/FetchPhase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java b/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java index 997194a9d8a..b8690133057 100644 --- a/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java +++ b/src/main/java/org/elasticsearch/search/fetch/FetchPhase.java @@ -145,7 +145,7 @@ public class FetchPhase implements SearchPhase { fieldSelectorMapper.add(SourceFieldMapper.NAME); } fieldSelector = fieldSelectorMapper; - } else if (extractFieldNames != null) { + } else if (extractFieldNames != null || sourceRequested) { fieldSelector = new UidAndSourceFieldSelector(); } else { fieldSelector = UidFieldSelector.INSTANCE;