mirror of
https://github.com/apache/lucene.git
synced 2025-02-27 21:09:19 +00:00
LUCENE-9613, LUCENE-10067: Add more specialization for the ordinals case.
This commit is contained in:
parent
45868a52f1
commit
8917fbe039
@ -469,6 +469,14 @@ final class Lucene90DocValuesProducer extends DocValuesProducer {
|
||||
return table[(int) values.get(doc)];
|
||||
}
|
||||
};
|
||||
} else if (entry.gcd == 1 && entry.minValue == 0) {
|
||||
// Common case for ordinals, which are encoded as numerics
|
||||
return new DenseNumericDocValues(maxDoc) {
|
||||
@Override
|
||||
public long longValue() throws IOException {
|
||||
return values.get(doc);
|
||||
}
|
||||
};
|
||||
} else {
|
||||
final long mul = entry.gcd;
|
||||
final long delta = entry.minValue;
|
||||
@ -522,6 +530,13 @@ final class Lucene90DocValuesProducer extends DocValuesProducer {
|
||||
return table[(int) values.get(disi.index())];
|
||||
}
|
||||
};
|
||||
} else if (entry.gcd == 1 && entry.minValue == 0) {
|
||||
return new SparseNumericDocValues(disi) {
|
||||
@Override
|
||||
public long longValue() throws IOException {
|
||||
return values.get(disi.index());
|
||||
}
|
||||
};
|
||||
} else {
|
||||
final long mul = entry.gcd;
|
||||
final long delta = entry.minValue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user