|
@@ -6,6 +6,7 @@
|
|
|
*/
|
|
|
package org.elasticsearch.xpack.enrich.action;
|
|
|
|
|
|
+import org.apache.lucene.index.StoredFields;
|
|
|
import org.apache.lucene.search.Query;
|
|
|
import org.apache.lucene.search.ScoreDoc;
|
|
|
import org.apache.lucene.search.Sort;
|
|
@@ -240,6 +241,7 @@ public class EnrichShardMultiSearchAction extends ActionType<MultiSearchResponse
|
|
|
throw new UnsupportedOperationException();
|
|
|
}, null, runtimeFields);
|
|
|
final MultiSearchResponse.Item[] items = new MultiSearchResponse.Item[request.multiSearchRequest.requests().size()];
|
|
|
+ StoredFields storedFields = searcher.storedFields();
|
|
|
for (int i = 0; i < request.multiSearchRequest.requests().size(); i++) {
|
|
|
final SearchSourceBuilder searchSourceBuilder = request.multiSearchRequest.requests().get(i).source();
|
|
|
|
|
@@ -255,9 +257,8 @@ public class EnrichShardMultiSearchAction extends ActionType<MultiSearchResponse
|
|
|
final SearchHit[] hits = new SearchHit[topDocs.scoreDocs.length];
|
|
|
for (int j = 0; j < topDocs.scoreDocs.length; j++) {
|
|
|
final ScoreDoc scoreDoc = topDocs.scoreDocs[j];
|
|
|
-
|
|
|
visitor.reset();
|
|
|
- searcher.doc(scoreDoc.doc, visitor);
|
|
|
+ storedFields.document(scoreDoc.doc, visitor);
|
|
|
visitor.postProcess(field -> {
|
|
|
if (context.isFieldMapped(field) == false) {
|
|
|
throw new IllegalStateException("Field [" + field + "] exists in the index but not in mappings");
|