}
if (inclusiveLowerPoint > inclusiveUpperPoint)
return DocSet.EMPTY_DOC_SET;
final DoubleFieldData fieldData = (DoubleFieldData) this.fieldDataCache.cache(FieldDataType.DefaultTypes.DOUBLE, reader, field);
return new GetDocSet(reader.maxDoc()) {
@Override public boolean isCacheable() {
// not cacheable for several reasons:
// 1. It is only relevant when _cache is set to true, and then, we really want to create in mem bitset
// 2. Its already fast without in mem bitset, since it works with field data
return false;
}
@Override public boolean get(int doc) throws IOException {
if (!fieldData.hasValue(doc)) {
return false;
}
if (fieldData.multiValued()) {
double[] values = fieldData.values(doc);
for (double value : values) {
if (value >= inclusiveLowerPoint && value <= inclusiveUpperPoint) {
return true;
}
}
return false;
} else {
double value = fieldData.value(doc);
return value >= inclusiveLowerPoint && value <= inclusiveUpperPoint;
}
}
};
}