[ 
https://issues.apache.org/jira/browse/SOLR-614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617368#action_12617368
 ] 

Shalin Shekhar Mangar commented on SOLR-614:
--------------------------------------------

Just to elaborate on the UpdateRequestProcessor use-case, right now we have 
modified SolrCore to add a method loadUpdateProcessorChains which has quite a 
bit of XPath parsing to create a NamedList which is passed to the 
UpdateRequestProcessorFactory. With this patch, the chain can just implement 
NamedListInitializedPlugin and the whole bit of parsing will be done 
automatically.

So the whole code in SolrCore#loadUpdateProcessorChains will look like this:
{code}
List<NamedList> initConfigs = 
solrConfig.getAllNodesAsNamedList("updateRequestProcessorChain");
    for (NamedList list : initConfigs)  {
      UpdateRequestProcessorChain chain = new UpdateRequestProcessorChain();
      chain.init(list);
      map.put((String)list.get("@name"), chain);
    }
{code}

The chain will have an init method like this:
{code}
public void init(NamedList args) {
    List<NamedList> processors = args.getAll("processor");
    for (NamedList processor : processors)  {
      UpdateRequestProcessorFactory p = 
(UpdateRequestProcessorFactory)core.getResourceLoader().newInstance((String)processor.get("@class"));
      p.init(processor);
    }
  }
{code}

So the chain can create all processors inside it rather than SolrCore creating 
processors and passing them into a chain constructor.

> Allow components to read any kind of XML from solrconfig
> --------------------------------------------------------
>
>                 Key: SOLR-614
>                 URL: https://issues.apache.org/jira/browse/SOLR-614
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Noble Paul
>            Assignee: Shalin Shekhar Mangar
>            Priority: Trivial
>             Fix For: 1.3
>
>         Attachments: SOLR-614.patch, SOLR-614.patch, SOLR-614.patch
>
>
> All the components initialized by Solr have an init(NamedList args) 
> initializer. This leads us to writing the configuration needed for the 
> component in the NamedList xml format. People familiar with Solr may know the 
> format but most of what is written is noise than information. For users who 
> are not familiar w/ the format find it too difficult to understand why they 
> have to write it this way. Moreover , it is not a very efficient way to 
> configure .

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to