From 0565536b7f606762f92fc113389e49e45de14d6f Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 31 Mar 2015 21:15:27 +0000 Subject: [PATCH] LUCENE-6271: fix bug in SortingDocsEnum git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene6271@1670483 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/index/SortingLeafReader.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lucene/misc/src/java/org/apache/lucene/index/SortingLeafReader.java b/lucene/misc/src/java/org/apache/lucene/index/SortingLeafReader.java index a87dea6955a..99b3d79ed58 100644 --- a/lucene/misc/src/java/org/apache/lucene/index/SortingLeafReader.java +++ b/lucene/misc/src/java/org/apache/lucene/index/SortingLeafReader.java @@ -487,6 +487,28 @@ public class SortingLeafReader extends FilterLeafReader { PostingsEnum getWrapped() { return in; } + + // we buffer up docs/freqs only, don't forward any positions requests to underlying enum + + @Override + public int nextPosition() throws IOException { + return -1; + } + + @Override + public int startOffset() throws IOException { + return -1; + } + + @Override + public int endOffset() throws IOException { + return -1; + } + + @Override + public BytesRef getPayload() throws IOException { + return null; + } } static class SortingPostingsEnum extends FilterPostingsEnum {