You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Noble Paul (JIRA)" <ji...@apache.org> on 2008/07/20 12:20:31 UTC
[jira] Issue Comment Edited: (SOLR-614) Allow components to read
any kind of XML from solrconfig
[ https://issues.apache.org/jira/browse/SOLR-614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610468#action_12610468 ]
noble.paul edited comment on SOLR-614 at 7/20/08 3:19 AM:
----------------------------------------------------------
If the configuration of a handler is as follows
{code:xml}
<requestHandler name="/foo" class="solr.FooHandler">
<defaults>
<name>some-name</name>
<classname>solr.MyClass</classname>
</defaults>
</requestHandler>
{code}
The values can be read from the iniArgs as follows
{code:java}
NamedList defaults = (NamedList )initArgs.get("default");
String name = (String)defaults.get("name");
String classname = (String)defaults.get("classname");
{code}
Even attributes can be read as in the following config
{code:xml}
<requestHandler name="/foo" class="solr.FooHandler">
<defaults name="default" name="somename" classname="solr.MyClass"/>
</requestHandler>
{code}
The values can be read from the iniArgs as follows
{code:java}
NamedList defaults = (NamedList )initArgs.get("default");
String name = (String)defaults.get("@name");
String classname = (String)defaults.get("@classname");
{code}
was (Author: noble.paul):
This patch can automatically make these representations equivalent. This is fully backward compitible.
* NamedList format: 1
{code:xml}
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<lst name="spellchecker">
<str name="name">default</str>
<str name="classname">solr.IndexBasedSpellChecker</str>
<str name="field">spell</str>
<str name="spellcheckIndexDir">./spellchecker</str>
</lst>
<lst name="spellchecker">
<str name="name">jarowinkler</str>
<str name="field">lowerfilt</str>
<str name="distanceMeasure">solr.JaroWinklerDistance</str>
<str name="spellcheckIndexDir">./spellchecker</str>
</lst>
</searchComponent>
{code}
* NamedList Format : 2
{code:xml}
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<spellchecker>
<name>default</name>
<classname>solr.IndexBasedSpellChecker</classname>
<field>spell</field>
<spellcheckIndexDir>./spellchecker</spellcheckIndexDir>
</spellchecker>
<spellchecker>
<name>jarowinkler</name>
<field>lowerfilt</field>
<distanceMeasure>solr.JaroWinklerDistance</distanceMeasure>
<spellcheckIndexDir>./spellchecker</spellcheckIndexDir>
</spellchecker>
</searchComponent>
{code}
*NamedList format :3
{code:xml}
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<spellchecker name="default" classname="solr.IndexBasedSpellChecker"
field="spell" spellcheckIndexDir="./spellchecker"/>
<spellchecker name="jarowinkler" field="lowerfilt"
distanceMeasure="solr.JaroWinklerDistance"
spellcheckIndexDir="./spellchecker"/>
</searchComponent>
{code}
> 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
> Priority: Trivial
> Fix For: 1.3
>
> Attachments: 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.