Thanks Michael, both the reasons make sense.

Currently I am not planning on using SolrCloud so as you suggested if I can
use http://wiki.apache.org/solr/CoreAdmin api. 
While doing that did you mean running a curl command similar to this, 
http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&config=config_file_name.xml&schema=schem_file_name.xml&dataDir=data
as a part of 'postinst' script? or running it manually on the host after the
index package is installed? ( I would love to do it as a part of pkg
installation.)

Also, there will be two cases here, if I am installing a new index package
in that case "create" will work however, if I am updating a package with
some tweaks to configs and schema then I need to check "status" to see if
core is available and if yes, use "reload" else "create". Does this make
sense?


Michael Della Bitta-2 wrote
> Hi,
> 
> I wouldn't edit solr.xml directly for two reasons. One being that an
> already running Solr installation won't update with changes to that file,
> and might actually overwrite the changes that you make to it. And two,
> it's
> going away in a future release of Solr.
> 
> Instead, I'd make the package that installed the Solr webapp and brought
> it
> up as you described, and have your independent index packages use either
> the CoreAdmin API or Collection API to create the indexes, depending on
> whether you're using Solr Cloud or not:
> 
> http://wiki.apache.org/solr/CoreAdmin
> https://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collections_API
> 
> 
> 
> Michael Della Bitta
> 
> Applications Developer
> 
> o: +1 646 532 3062  | c: +1 917 477 7906
> 
> appinions inc.
> 
> “The Science of Influence Marketing”
> 
> 18 East 41st Street
> 
> New York, NY 10017
> 
> t: @appinions <https://twitter.com/Appinions> | g+:
> plus.google.com/appinions
> w: appinions.com <http://www.appinions.com/>
> 
> 
> On Wed, Jun 19, 2013 at 8:27 PM, smanad <

> smanad@

> > wrote:
> 
>> Hi,
>> Is there a way to edit solr.xml as a part of debian package installation
>> to
>> add new cores.
>> In my use case, there 4 solr indexes and they are managed/configured by
>> different teams.
>> The way I am thinking packages will work is as described below,
>> 1. There will be a solr-base debian package which comes with solr
>> installtion with tomcat setup (I am planning to use solr 4.3)
>> 2. There will be individual index debian packages like,
>> solr-index1, solr-index2 which will be dependent on solr-base.
>> Each package's DEBIAN postinst script will have a logic to edit solr.xml
>> to
>> add new index like index1, index2, etc.
>>
>> Does this sound good? or is there a better/different way to do this?
>> Any pointers will be much appreciated.
>> Thanks,
>> -M
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/update-solr-xml-dynamically-to-add-new-cores-tp4071800.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>





--
View this message in context: 
http://lucene.472066.n3.nabble.com/update-solr-xml-dynamically-to-add-new-cores-tp4071800p4071970.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to