[
https://issues.apache.org/jira/browse/SOLR-8113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hoss Man updated SOLR-8113:
---------------------------
Attachment: SOLR-8113.patch
Gus: This is definitely along the lines of what I had in mind -- and i like
your test refactoring / additions.
I've updated the patch as I reviewed -- mainly in the ariea of documentation
and additional error handling/messages when parsing the config...
{panel}
* removed stray addition to FirstFieldValueUpdateProcessorFactory javadocs ...
left over from old patch?
* CloneFieldUpdateProcessorFactory javadocs:
** fixed <pattern> to <str name="pattern"> (and likewise for replacement
** clarify what the the literals & types were for the new config in the
description
** reworded example description to be bulleted list instead of run on
sentence(s)
** moved/reworded "common case" explanation to the end, after all the major
functionality is explained, to clarify it's syntactic sugar and put next to
it's example.
** replaced the one off comment about FirstValueUpdateProcessor with a more
general comment about cloning into multivalue fields and various
FieldValueSubsetUpdateProcessorFactory options
* CloneFieldUpdateProcessorFactoryTest
** standardized indenting
** updated testCloneFieldExample to include the additions made to the javadoc
example
** updated testCloneCombinations to include a first value clone test
*** added corrisponding clone-first to solrconfig-update-processor-chains.xml
** updated testCloneField with more equivilence tests -- this helps ensure
we've got good coverage for the case where multi-selector + pattern +
replacement that results in single dest field getting values from multiple
source fields.
*** added corrisponding new clone-single-regex, clone-multi-regex,
clone-array-regex, clone-selector-regex and clone-simple-regex-syntax to
solrconfig-update-processor-chains.xml as needed
* CloneFieldUpdateProcessorFactory code:
** fixed getInstance to use getSourceSelector for safe error handling
(eliminates the unused warning you asked about)
** refactored init method into 2 helper methods specific to the two syntax
styles (readability)
** tweaked config error messages & added additional error handling of bad
config combos
** improved error reporting when pattern is invalid and can't be compile
{panel}
My one remaining concern with this patch is the use of Matcher.replaceFirst ...
i feel like we should probably be using Matcher.replaceAll since it would
provide a feature superset of replaceFirst (ie: using replaceAll can still
support all the current patch behavior via start/end bound constraints +
capture groups, but replaceFirst can't support everything possible with
replaceAll).
Gus: What do you think?
> Accept replacement strings in CloneFieldUpdateProcessorFactory
> --------------------------------------------------------------
>
> Key: SOLR-8113
> URL: https://issues.apache.org/jira/browse/SOLR-8113
> Project: Solr
> Issue Type: Improvement
> Components: update
> Affects Versions: 5.3
> Reporter: Gus Heck
> Assignee: Hoss Man
> Attachments: SOLR-8113.patch, SOLR-8113.patch, SOLR-8113.patch
>
>
> Presently CloneFieldUpdateProcessorFactory accepts regular expressions to
> select source fields, which mirrors wildcards in the source for copyField in
> the schema. This patch adds a counterpart to copyField's wildcards in the
> dest attribute by interpreting the dest parameter as a regex replacement
> string.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]