mirror of https://github.com/apache/lucene.git
LUCENE-7737: Guard against empty binary docvalues
This commit is contained in:
parent
3bd1115964
commit
6fcc7cd731
|
@ -26,6 +26,7 @@ import java.io.IOException;
|
||||||
import org.apache.lucene.document.BinaryDocValuesField;
|
import org.apache.lucene.document.BinaryDocValuesField;
|
||||||
import org.apache.lucene.document.Field;
|
import org.apache.lucene.document.Field;
|
||||||
import org.apache.lucene.index.BinaryDocValues;
|
import org.apache.lucene.index.BinaryDocValues;
|
||||||
|
import org.apache.lucene.index.DocValues;
|
||||||
import org.apache.lucene.index.LeafReaderContext;
|
import org.apache.lucene.index.LeafReaderContext;
|
||||||
import org.apache.lucene.search.ConstantScoreScorer;
|
import org.apache.lucene.search.ConstantScoreScorer;
|
||||||
import org.apache.lucene.search.ConstantScoreWeight;
|
import org.apache.lucene.search.ConstantScoreWeight;
|
||||||
|
@ -163,7 +164,7 @@ public class SerializedDVStrategy extends SpatialStrategy {
|
||||||
}//PredicateValueSourceQuery
|
}//PredicateValueSourceQuery
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements a ValueSource by deserializing a Shape in from BinaryDocValues using BinaryCodec.
|
* Implements a ShapeValueSource by deserializing a Shape from BinaryDocValues using BinaryCodec.
|
||||||
* @see #makeShapeValueSource()
|
* @see #makeShapeValueSource()
|
||||||
*/
|
*/
|
||||||
static class ShapeDocValueSource extends ShapeValuesSource {
|
static class ShapeDocValueSource extends ShapeValuesSource {
|
||||||
|
@ -178,7 +179,7 @@ public class SerializedDVStrategy extends SpatialStrategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ShapeValues getValues(LeafReaderContext readerContext) throws IOException {
|
public ShapeValues getValues(LeafReaderContext readerContext) throws IOException {
|
||||||
final BinaryDocValues docValues = readerContext.reader().getBinaryDocValues(fieldName);
|
final BinaryDocValues docValues = DocValues.getBinary(readerContext.reader(), fieldName);
|
||||||
|
|
||||||
return new ShapeValues() {
|
return new ShapeValues() {
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue