mikemccand commented on code in PR #12829:
URL: https://github.com/apache/lucene/pull/12829#discussion_r1440776102


##########
lucene/core/src/java/org/apache/lucene/index/FieldInfos.java:
##########
@@ -437,6 +488,33 @@ private void verifySoftDeletedFieldName(String fieldName, 
boolean isSoftDeletesF
       }
     }
 
+    private void verifyParentFieldName(String fieldName, boolean 
isParentField) {
+      if (isParentField) {
+        if (parentFieldName == null) {
+          throw new IllegalArgumentException(
+              "this index has ["
+                  + fieldName
+                  + "] as parent document field already but parent document 
field is not configured in IWC");
+        } else if (fieldName.equals(parentFieldName) == false) {
+          throw new IllegalArgumentException(
+              "cannot configure ["
+                  + parentFieldName
+                  + "] as parent document field ; this index uses ["
+                  + fieldName

Review Comment:
   OK I am still confused here -- this looks backwards to me (`fieldName` and 
`parentFieldName` should be swapped)?
   
   I.e. `parentFieldName` was derived from the index as the already established 
parent field, and now a newly indexed document / current IWC is attempting to 
set `fieldName` as the parent field?



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