mayya-sharipova commented on code in PR #16219:
URL: https://github.com/apache/lucene/pull/16219#discussion_r3405979215


##########
lucene/core/src/java/org/apache/lucene/index/IndexingChain.java:
##########
@@ -744,14 +746,34 @@ void processBatch(int baseDocID, ColumnBatch columnBatch) 
throws IOException {
       }
       docFields[columnIdx++] = pf;
 
-      if (pf.fieldGen == batchGen) {
+      if (pf.fieldGen != batchGen) {
+        // First column for this field name in this batch: start a fresh 
schema and feature set, and
+        // collect the field once so its FieldInfo is initialized/validated 
after the loop.
+        pf.fieldGen = batchGen;
+        pf.columnFeatures = 0;
+        pf.schema.reset(baseDocID);
+        fields[uniqueFieldCount++] = pf;
+      }
+
+      // Each indexing feature must come from a single column for a given 
field name.
+      int columnFeatures = ColumnValidation.featureMask(fieldType);
+      int overlap = pf.columnFeatures & columnFeatures;

Review Comment:
   Should we only calculate overlap if pf.fieldGen == batchGen?
   
   if (pf.fieldGen != batchGen) {
         pf.fieldGen = batchGen;
         pf.columnAspects = 0;
         pf.schema.reset(baseDocID);
         fields[uniqueFieldCount++] = pf;
     } else {
         int overlap = pf.columnAspects & 
ColumnValidation.aspectMask(fieldType);



##########
lucene/core/src/java/org/apache/lucene/index/IndexingChain.java:
##########
@@ -744,14 +746,34 @@ void processBatch(int baseDocID, ColumnBatch columnBatch) 
throws IOException {
       }
       docFields[columnIdx++] = pf;
 
-      if (pf.fieldGen == batchGen) {
+      if (pf.fieldGen != batchGen) {
+        // First column for this field name in this batch: start a fresh 
schema and feature set, and
+        // collect the field once so its FieldInfo is initialized/validated 
after the loop.
+        pf.fieldGen = batchGen;
+        pf.columnFeatures = 0;
+        pf.schema.reset(baseDocID);
+        fields[uniqueFieldCount++] = pf;
+      }
+
+      // Each indexing feature must come from a single column for a given 
field name.
+      int columnFeatures = ColumnValidation.featureMask(fieldType);
+      int overlap = pf.columnFeatures & columnFeatures;

Review Comment:
   Should we only calculate overlap if pf.fieldGen == batchGen?
   
   ```
   if (pf.fieldGen != batchGen) {
         pf.fieldGen = batchGen;
         pf.columnAspects = 0;
         pf.schema.reset(baseDocID);
         fields[uniqueFieldCount++] = pf;
     } else {
         int overlap = pf.columnAspects & 
ColumnValidation.aspectMask(fieldType);
   ```



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

Reply via email to