You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/09/29 17:21:04 UTC

[GitHub] [lucene] jpountz opened a new pull request #330: LUCENE-10133: Specialize the write path for sorted doc values.

jpountz opened a new pull request #330:
URL: https://github.com/apache/lucene/pull/330


   The min value, the max value, the GCD and the set of unique values don't need
   to be computed on sorted doc values.


-- 
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-unsubscribe@lucene.apache.org

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



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


[GitHub] [lucene] gsmiller commented on a change in pull request #330: LUCENE-10133: Specialize the write path for sorted doc values.

Posted by GitBox <gi...@apache.org>.
gsmiller commented on a change in pull request #330:
URL: https://github.com/apache/lucene/pull/330#discussion_r722206683



##########
File path: lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesConsumer.java
##########
@@ -496,6 +516,25 @@ public void addSortedField(FieldInfo field, DocValuesProducer valuesProducer) th
 
   private void doAddSortedField(FieldInfo field, DocValuesProducer valuesProducer)
       throws IOException {
+
+    int numDocsWithValue = 0;
+    MinMaxTracker blockMinMax = new MinMaxTracker();
+
+    SortedDocValues sorted = valuesProducer.getSorted(field);
+    for (int doc = sorted.nextDoc(); doc < DocIdSetIterator.NO_MORE_DOCS; doc = sorted.nextDoc()) {
+      final int v = sorted.ordValue();
+      blockMinMax.update(v);
+      if (blockMinMax.numValues == NUMERIC_BLOCK_SIZE) {
+        blockMinMax.nextBlock();
+      }
+      numDocsWithValue++;
+    }
+    blockMinMax.finish();
+

Review comment:
       Maybe a comment for a future reader lacking context?
   
   ```suggestion
   
   // ordinals will always have a min value of 0 and a max of length - 1:
   ```




-- 
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-unsubscribe@lucene.apache.org

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



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