[
https://issues.apache.org/jira/browse/SOLR-2841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128966#comment-13128966
]
Jan Høydahl commented on SOLR-2841:
-----------------------------------
The DSL could be based on Groovy, JRuby, Jython or JS. Here's my quasi sketch
of a Groovy example from 2823:
...This approach also solves another wish of mine, namely being able to define
chains outside of solrconfig.xml. Logically, configuring schema and document
processing is done by a "content" guy, but configuring solrconfig.xml is done
by the "hardware/operations" guys. Imagine a solr/conf/pipeline.groovy defined
in solrconfig.xml:
{code:xml}
<updateProcessorChain class="solr.ScriptedUpdateProcessorChainFactory"
file="updateprocessing.groovy" />
{code}
updateprocessing.groovy:
{code}
chain simple {
process(langid)
process(copyfield)
chain(logAndRun)
}
chain moreComplex {
process(langid)
if(doc.getFieldValue("employees") > 10)
process(copyfield)
else
chain(myOtherProcesses)
doc.deleteField("title")
chain(logAndRun)
}
chain logAndRun {
process(log)
process(run)
}
processor langid {
class = "solr.LanguageIdentifierUpdateProcessorFactory"
config("langid.fl", "title,body")
config("langid.langField", "language")
config("map", true)
}
processor copyfield {
script = "copyfield.groovy"
config("from", "title")
config("to", "title_en")
}
{code}
I don't know what it takes to code such a thing, but if we had it, I'd never go
back to defining pipelines in XML :)
> Scriptable UpdateRequestChain
> -----------------------------
>
> Key: SOLR-2841
> URL: https://issues.apache.org/jira/browse/SOLR-2841
> Project: Solr
> Issue Type: New Feature
> Components: update
> Reporter: Jan Høydahl
>
> UpdateProcessorChains must currently be defined with XML in solrconfig.xml.
> We should explore a scriptable chain implementation with a DSL that allows
> for full flexibility. The first step would be to make UpdateChain
> implementations pluggable in solrconfig.xml, for backward compat support.
> Benefits and possibilities with a Scriptable UpdateChain:
> * A compact DSL for defining Processors and Chains (Workflows would be a
> better, less limited term here)
> * Keeping update processor config separate from solrconfig.xml gives better
> separations of roles
> * Use this as an opportunity to natively support scripting language
> Processors (ideas from SOLR-1725)
> This issue is spun off from SOLR-2823.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]