LUCENE-7643,SOLR-10013: Reenable the single-value optimization for sorted dv too.

This commit is contained in:
Adrien Grand 2017-02-10 09:25:31 +01:00
parent 62489678d0
commit 0215c65ac5
1 changed files with 2 additions and 3 deletions

View File

@ -19,6 +19,7 @@ package org.apache.lucene.document;
import java.io.IOException;
import java.util.Objects;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
@ -143,11 +144,9 @@ abstract class SortedSetDocValuesRangeQuery extends Query {
return null;
}
final SortedDocValues singleton = null; // TODO: LUCENE-7649, re-consider optimization that broke SOLR-10013
// final SortedDocValues singleton = DocValues.unwrapSingleton(values);
final SortedDocValues singleton = DocValues.unwrapSingleton(values);
final TwoPhaseIterator iterator;
if (singleton != null) {
assert false : "imposible code -- or: someone re-enabled singleton optinization w/o reading the whole method";
iterator = new TwoPhaseIterator(singleton) {
@Override
public boolean matches() throws IOException {