diff --git a/src/main/java/org/elasticsearch/action/termvector/TransportSingleShardTermVectorAction.java b/src/main/java/org/elasticsearch/action/termvector/TransportSingleShardTermVectorAction.java index 55222c21110..90ad6f106c2 100644 --- a/src/main/java/org/elasticsearch/action/termvector/TransportSingleShardTermVectorAction.java +++ b/src/main/java/org/elasticsearch/action/termvector/TransportSingleShardTermVectorAction.java @@ -108,8 +108,9 @@ public class TransportSingleShardTermVectorAction extends TransportShardSingleOp try { Fields topLevelFields = MultiFields.getFields(topLevelReader); Versions.DocIdAndVersion docIdAndVersion = Versions.loadDocIdAndVersion(topLevelReader, uidTerm); - if(docIdAndVersion!=null) { - termVectorResponse.setFields(topLevelReader.getTermVectors(docIdAndVersion.docId), request.selectedFields(), + + if (docIdAndVersion != null) { + termVectorResponse.setFields(docIdAndVersion.context.reader().getTermVectors(docIdAndVersion.docId), request.selectedFields(), request.getFlags(), topLevelFields); termVectorResponse.setDocVersion(docIdAndVersion.version); } else {