jpountz commented on code in PR #13208: URL: https://github.com/apache/lucene/pull/13208#discussion_r1537732974
########## lucene/core/src/java/org/apache/lucene/index/MergeState.java: ########## @@ -266,4 +266,35 @@ static PackedLongValues removeDeletes(final int maxDoc, final Bits liveDocs) { } return docMapBuilder.build(); } + + /** + * Creates a new state from an existing state with new fieldInfos and FieldsProducer. + * + * @param state the state to be copied + * @param mergeFieldInfos the new field infos of the merged segment + * @param fieldInfos the new field infos + * @param fieldsProducers the new field producers + */ + public MergeState( Review Comment: I'm not too happy with this constructor being public since it's really an implementation detail of `PerFieldMergeState `. At the same time, I like having the per-field-specific logic in the `.perfield` package rather than here. I'm not sure how to fix this cleanly... my best idea at this point would be to store all parameters of the main `MergeState` constructor on the `MergeState` object, so that `PerFieldMergeState` can then call this constructor again, wrapping codec readers with a `FilterCodecReader` that only exposes a subset of fields? -- 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