s1monw commented on code in PR #12829: URL: https://github.com/apache/lucene/pull/12829#discussion_r1442110320
########## 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: I think this is confusing from it's name. The `parentFieldName` comes from IWC and fieldname is the incoming field. I think it's right the way it is, maybe we need to do some rewording altogether but when you look at the tests I think the error message makes sense? I would like to find a way that users don't have to specify these fieldnames altogether but that should be a follow up -- 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