lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shalin Shekhar Mangar <shalinman...@gmail.com>
Subject Re: Default query parameter for one core
Date Sun, 11 Oct 2009 04:30:10 GMT
On Fri, Oct 9, 2009 at 9:39 PM, Michael <solrcoder@gmail.com> wrote:

> For posterity...
>
> After reading through http://wiki.apache.org/solr/SolrConfigXml and
> http://wiki.apache.org/solr/CoreAdmin and
> http://issues.apache.org/jira/browse/SOLR-646, I think there's no way
> for me to make only one core specify &shards=foo, short of duplicating
> my solrconfig.xml for that core and adding one line:
>
> - I can't use a variable like ${shardsParam} in a single shared
> solrconfig.xml, because the line
>    <str name="shards">${shardsParam}</str>
>  has to be in there, and that forces a (possibly empty) &shards
> parameter onto cores that *don't* need one, causing a
> NullPointerException.
>
>
Well, we can fix the NPE :)

Please raise an issue.


> - I can't suck in just that one <str> line via a SOLR-646-style import,
> like
>    #solrconfig.xml
>    <requestHandler>
>      <lst name="defaults">
>        <import file="${shardspec_file}"/>
>      </list>
>    </requestHandler>
>    #solr.xml
>    <core name="core0"><property name="shardspec_file"
> value="some_file"/>...
>    <core name="core1"><property name="shardspec_file"
> value="/dev/null"/>...
>  because SOLR-646's <import> feature got cut.
>
> So I think my best bet is to make two mostly-identical
> solrconfig.xmls, and point core0 to the one specifying a &shards=
> parameter:
>    <core name="core0" config="core0_solrconfig.xml"/>
>
> I don't like the duplication of config, but at least it accomplishes my
> goal!
>
>
There is another way too. Each plugin in Solr now supports a configuration
attribute named "enable" which can be true or false. You can control the
value (true/false) through a variable. So you can duplicate just the handle
instead of the complete solrconfig.xml

-- 
Regards,
Shalin Shekhar Mangar.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message