jpountz commented on code in PR #967:
URL: https://github.com/apache/lucene/pull/967#discussion_r905889905


##########
lucene/core/src/java/org/apache/lucene/index/SortedSetDocValuesWriter.java:
##########
@@ -114,6 +116,7 @@ private void finishCurrentDoc() {
       }
       lastValue = termID;
     }
+    maxBitsRequired |= count;

Review Comment:
   If you are or-ing values, then it's not a number of bits per value. Maybe 
compute the max count instead, and later compute the number of bits required 
using `PackedInts#bitsRequired`?



##########
lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java:
##########
@@ -805,11 +805,9 @@ public int nextDoc() throws IOException {
                 int doc = values.nextDoc();
                 if (doc != NO_MORE_DOCS) {
                   docValueCount = 0;
-                  for (long ord = values.nextOrd();
-                      ord != SortedSetDocValues.NO_MORE_ORDS;
-                      ord = values.nextOrd()) {
+                  for (int j = 0; j < values.docValueCount(); j++) {
                     ords = ArrayUtil.grow(ords, docValueCount + 1);

Review Comment:
   Let's move this `grow` call outside of the loop since the number of values 
in known up-front?



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to