LuXugang commented on code in PR #967:
URL: https://github.com/apache/lucene/pull/967#discussion_r908003266
##########
lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java:
##########
@@ -415,34 +419,45 @@ public BytesRef lookupOrd(long ord) throws IOException {
public long getValueCount() {
return in.getValueCount();
}
+
+ private void initCount() {
+ assert docID >= 0;
+ ordUpto = ords.offsets[docID] - 1;
+ count = (int) ords.docValueCounts.get(docID);
+ limit = ordUpto + count;
+ }
}
static final class DocOrds {
final long[] offsets;
final PackedLongValues ords;
+ final GrowableWriter docValueCounts;
+
+ public static final int START_BITS_PER_VALUE = 2;
DocOrds(
int maxDoc,
Sorter.DocMap sortMap,
SortedSetDocValues oldValues,
- float acceptableOverheadRatio)
+ float acceptableOverheadRatio,
+ int bitsPerValue)
throws IOException {
offsets = new long[maxDoc];
PackedLongValues.Builder builder =
PackedLongValues.packedBuilder(acceptableOverheadRatio);
- long ordOffset = 1; // 0 marks docs with no values
+ docValueCounts = new GrowableWriter(bitsPerValue, maxDoc,
acceptableOverheadRatio);
+ long ordOffset = 1;
Review Comment:
Thanks, I saw `SortingSortedNumericDocValues` has the same logic, maybe we
could fix it on a separate issues .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]