mirror of https://github.com/apache/lucene.git
SOLR-2923: IllegalArgumentException when using useFilterForSortedQuery on an empty index.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1342702 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
50baab7c4b
commit
a72fb4fb77
|
@ -446,6 +446,9 @@ Bug Fixes
|
|||
|
||||
* LUCENE-4075: Cleaner path usage in TestXPathEntityProcessor
|
||||
(Greg Bowyer via hossman)
|
||||
|
||||
* SOLR-2923: IllegalArgumentException when using useFilterForSortedQuery on an
|
||||
empty index. (Adrien Grand via Mark Miller)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
|
|
@ -1784,7 +1784,12 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable,SolrIn
|
|||
}
|
||||
|
||||
protected DocList sortDocSet(DocSet set, Sort sort, int nDocs) throws IOException {
|
||||
// bit of a hack to tell if a set is sorted - do it better in the futute.
|
||||
if (nDocs == 0) {
|
||||
// SOLR-2923
|
||||
return new DocSlice(0, 0, new int[0], null, 0, 0f);
|
||||
}
|
||||
|
||||
// bit of a hack to tell if a set is sorted - do it better in the future.
|
||||
boolean inOrder = set instanceof BitDocSet || set instanceof SortedIntDocSet;
|
||||
|
||||
TopDocsCollector topCollector = TopFieldCollector.create(weightSort(sort), nDocs, false, false, false, inOrder);
|
||||
|
|
Loading…
Reference in New Issue