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-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