From 7d13f3ecd227fdf723cbe893655ee951812c0ae1 Mon Sep 17 00:00:00 2001 From: mikemccand Date: Thu, 29 Sep 2016 21:24:13 +0200 Subject: [PATCH] SOLR-9582: reset lastDocID when switching to a new LeafReader --- .../java/org/apache/solr/response/SortingResponseWriter.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/response/SortingResponseWriter.java b/solr/core/src/java/org/apache/solr/response/SortingResponseWriter.java index 709abc90a73..23a17cf4c9e 100644 --- a/solr/core/src/java/org/apache/solr/response/SortingResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/SortingResponseWriter.java @@ -871,6 +871,7 @@ public class SortingResponseWriter implements QueryResponseWriter { public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); + lastDocID = 0; } public void setCurrentValue(int docId) throws IOException { @@ -962,6 +963,7 @@ public class SortingResponseWriter implements QueryResponseWriter { public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); + lastDocID = 0; } public void setCurrentValue(int docId) throws IOException { @@ -1054,6 +1056,7 @@ public class SortingResponseWriter implements QueryResponseWriter { public void setNextReader(LeafReaderContext context) throws IOException { this.vals = DocValues.getNumeric(context.reader(), field); + lastDocID = 0; } public void setCurrentValue(int docId) throws IOException { @@ -1146,6 +1149,7 @@ public class SortingResponseWriter implements QueryResponseWriter { public void setNextReader(LeafReaderContext context) throws IOException { this.reader = context.reader(); this.vals = DocValues.getNumeric(this.reader, this.field); + lastDocID = 0; } public void setCurrentValue(int docId) throws IOException {