diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/all/AllEntries.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/all/AllEntries.java index 8818a68889e..5947f3ffd5d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/all/AllEntries.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/all/AllEntries.java @@ -160,6 +160,9 @@ public class AllEntries extends Reader { current = it.next(); } else { current = null; + if (read == 0) { + return -1; + } return read; } cbuf[off++] = ' ';