epugh commented on PR #5096: URL: https://github.com/apache/solr/pull/5096#issuecomment-7365754709
### Suggestion: make atomic operand mutation opt-in Right now `mutateAtomicOperands()` returns `true` by default, so every `FieldMutatingUpdateProcessor` mutates atomic-update operands unless it opts out. In core, only two kinds of processor work one value at a time and should touch operands: - `FieldValueMutatingUpdateProcessor`: Trim, Truncate, RegexReplace, HTMLStrip, RemoveBlank, FieldLength - `AllValuesOrNoneFieldMutatingUpdateProcessor`: ParseDate, ParseBoolean, ParseInt/Long/Float/Double Every processor that works on all of a field's values at once goes through `mutator()` and now has to opt out by hand: Concat, Count, First/Last/Min/Max/Uniq and Ignore. Flipping the default would be simpler and safer: - The base class returns `false`, and those two per-value classes return `true`. - The opt-outs in Concat, Count, FieldValueSubset and Ignore go away. - The 4-argument `mutator(...)` overload is only needed if a lambda-based processor wants to opt in. - Custom `FieldMutatingUpdateProcessor` subclasses written for whole-field semantics keep working as before. Under the current default they silently start receiving single operands. The built-in processors behave the same either way. Do you want to make this change? -- 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]
