LUCENE-7643,SOLR-10013: Reenable the single-value optimization.

This commit is contained in:
Adrien Grand 2017-01-23 10:31:44 +01:00
parent 5bdc492c9c
commit 6693c261e5
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;
@ -99,11 +100,9 @@ abstract class SortedNumericDocValuesRangeQuery extends Query {
if (values == null) {
return null;
}
final NumericDocValues singleton = null; // TODO: LUCENE-7649, re-consider optimization that broke SOLR-10013
// final NumericDocValues singleton = DocValues.unwrapSingleton(values);
final NumericDocValues 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 {