public class CmsSolrCopyModifiedUpateProcessorFactory extends org.apache.solr.update.processor.UpdateRequestProcessorFactory
For example, with the configuration listed below, the sequence in field path
will be matched against the regex (.*)_([a-z]{2}(?:_[A-Z]{2})?)((?:\.[^\.]*)?)$,
where matched parts will be replaced by $1$3, i.e., the first and third group of the match.
The resulting sequence will be written to path_remove_locale.
<processor class="org.opencms.search.solr.updateprocessors.CmsSolrCopyModifiedUpateProcessorFactory">
<str name="source">path</str>
<str name="target">path_remove_locale</str>
<str name="regex">(.*)_([a-z]{2}(?:_[A-Z]{2})?)((?:\.[^\.]*)?)$</str>
<str name="replacement">$1$3</str>
</processor>
If, e.g., a document with value "document_de.txt" in field source is processed, the field
path_remove_locale with value "document.txt will be added.
To add the update processor to your installation, define an update processor chain as in the following example.
<updateRequestProcessorChain name="mychain" default="true">
<processor class="org.opencms.search.solr.updateprocessors.CmsSolrCopyModifiedUpateProcessorFactory">
<str name="source">path</str>
<str name="target">path_remove_locale</str>
<str name="regex">(.*)_([a-z]{2}(?:_[A-Z]{2})?)((?:\.[^\.]*)?)$</str>
<str name="replacement">$1$3</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>UpdateRequestProcessorChain,
Pattern| Constructor and Description |
|---|
CmsSolrCopyModifiedUpateProcessorFactory() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.solr.update.processor.UpdateRequestProcessor |
getInstance(org.apache.solr.request.SolrQueryRequest req,
org.apache.solr.response.SolrQueryResponse rsp,
org.apache.solr.update.processor.UpdateRequestProcessor next) |
void |
init(org.apache.solr.common.util.NamedList args)
Read the parameters on initialization.
|
public CmsSolrCopyModifiedUpateProcessorFactory()
public org.apache.solr.update.processor.UpdateRequestProcessor getInstance(org.apache.solr.request.SolrQueryRequest req, org.apache.solr.response.SolrQueryResponse rsp, org.apache.solr.update.processor.UpdateRequestProcessor next)
getInstance in class org.apache.solr.update.processor.UpdateRequestProcessorFactoryUpdateRequestProcessorFactory.getInstance(org.apache.solr.request.SolrQueryRequest, org.apache.solr.response.SolrQueryResponse, org.apache.solr.update.processor.UpdateRequestProcessor)public void init(org.apache.solr.common.util.NamedList args)
init in interface org.apache.solr.util.plugin.NamedListInitializedPlugininit in class org.apache.solr.update.processor.UpdateRequestProcessorFactoryUpdateRequestProcessorFactory.init(org.apache.solr.common.util.NamedList)