From f4022dc68a3a83024b87fbc1dffb4cb4dfee0ccf Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Sat, 7 May 2016 11:45:59 -0400 Subject: [PATCH] LUCENE-6766: don't throw exc from MultiXXX if there is an index sort --- lucene/core/src/java/org/apache/lucene/index/MultiSorter.java | 2 +- .../core/src/java/org/apache/lucene/search/IndexSearcher.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiSorter.java b/lucene/core/src/java/org/apache/lucene/index/MultiSorter.java index 062dde9dc5d..7f71eb55880 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MultiSorter.java +++ b/lucene/core/src/java/org/apache/lucene/index/MultiSorter.java @@ -123,7 +123,7 @@ final class MultiSorter { private static CrossReaderComparator getComparator(List readers, SortField sortField) throws IOException { switch(sortField.getType()) { - // TODO: use global ords for string sort + // ncommit: use segment-local ords for string sort case INT: { List values = new ArrayList<>(); diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java index 3ac64c84c5d..b81b8079a1c 100644 --- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java +++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java @@ -819,6 +819,7 @@ public class IndexSearcher { sumTotalTermFreq = terms.getSumTotalTermFreq(); sumDocFreq = terms.getSumDocFreq(); } + return new CollectionStatistics(field, reader.maxDoc(), docCount, sumTotalTermFreq, sumDocFreq); } }