easyice commented on code in PR #12381:
URL: https://github.com/apache/lucene/pull/12381#discussion_r1247414106


##########
lucene/core/src/java/org/apache/lucene/index/NormValuesWriter.java:
##########
@@ -76,7 +76,8 @@ public void flush(SegmentWriteState state, Sorter.DocMap 
sortMap, NormsConsumer
           NumericDocValuesWriter.sortDocValues(
               state.segmentInfo.maxDoc(),
               sortMap,
-              new BufferedNorms(values, docsWithField.iterator()));
+              new BufferedNorms(values, docsWithField.iterator()),
+              docsWithField.dense() && sortMap.size() == 
docsWithField.cardinality());

Review Comment:
   no,DocsWithFieldSet will update it's bitset when a doc with field really 
added only, in sparse, it will not call call DocsWithFieldSet#add, so if the 
first 64 doc with field has added, and then some doc added without this filed, 
the docsWithField.dense() will return true, i think we can remove 
`docsWithField.dense()`, use  `sortMap.size() == docsWithField.cardinality()` 
only for dense case, the sortMap.size() will return the number of documents for 
the LeafReader, what do you think?



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