Notice: This test was done with a fresh install of Solr either 4.4 or 4.5.
curl http://localhost:8983/solr/admin/collections\?action\=CREATE\&name\=statistics-13\&numShards\=2\&maxShardsPerNode\=2\&collection.configName\=stats
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">3027</int></lst><lst name="success"><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">2886</int></lst><str name="core">statistics-13_shard1_replica1</str><str name="saved">/usr/local/Cellar/solr/4.4.0/libexec/example/solr/solr.xml</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">2915</int></lst><str name="core">statistics-13_shard2_replica1</str><str name="saved">/usr/local/Cellar/solr/4.4.0/libexec/example/solr/solr.xml</str></lst></lst>
</response>
curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=statistics-13_shard1_replica2&collection=statistics-13&shard=shard1'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1234</int></lst><str name="core">statistics-13_shard1_replica2</str><str name="saved">/usr/local/Cellar/solr/4.4.0/libexec/example/solr/solr.xml</str>
</response>
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores defaultCoreName="collection1" host="${host:}" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core shard="shard1" instanceDir="statistics-13_shard1_replica1/" name="statistics-13_shard1_replica1" collection="statistics-13"/>
<core shard="shard2" instanceDir="statistics-13_shard2_replica1/" name="statistics-13_shard2_replica1" collection="statistics-13"/>
<core shard="shard1" instanceDir="statistics-13_shard1_replica2/" name="statistics-13_shard1_replica2" collection="statistics-13"/>
</cores>
</solr>
curl http://localhost:8983/solr/admin/collections\?action\=CREATE\&name\=statistics-13\&numShards\=2\&maxShardsPerNode\=2\&collection.configName\=stats
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">4524</int></lst><lst name="success"><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">2893</int></lst><str name="core">statistics-13_shard1_replica1</str></lst><lst><lst name="responseHeader"><int name="status">0</int><int name="QTime">2895</int></lst><str name="core">statistics-13_shard2_replica1</str></lst></lst>
</response>
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores defaultCoreName="collection1" host="${host:}" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core name="collection1" loadOnStartup="true" instanceDir="collection1" shard="shard0" transient="false" collection="collection1"/>
</cores>
</solr>
Notice: The collection created is not save into solr.xml.
curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=statistics-13_shard1_replica2&collection=statistics-13&shard=shard1'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">2454</int></lst><str name="core">statistics-13_shard1_replica2</str>
</response>
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores defaultCoreName="collection1" host="${host:}" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core name="collection1" loadOnStartup="true" instanceDir="collection1" shard="shard0" transient="false" collection="collection1"/>
<core numShards="2" name="statistics-13_shard1_replica1" instanceDir="statistics-13_shard1_replica1" shard="shard1" collection="statistics-13"/>
<core numShards="2" name="statistics-13_shard2_replica1" instanceDir="statistics-13_shard2_replica1" shard="shard2" collection="statistics-13"/>
</cores>
</solr>
Notice: Now the last command it's save on solr.xml, but the replica created with command is not.
Replay the replica command and we have:
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true">
<cores defaultCoreName="collection1" host="${host:}" adminPath="/admin/cores" zkClientTimeout="${zkClientTimeout:15000}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core name="collection1" loadOnStartup="true" instanceDir="collection1" shard="shard0" transient="false" collection="collection1"/>
<core numShards="2" name="statistics-13_shard1_replica1" instanceDir="statistics-13_shard1_replica1" shard="shard1" collection="statistics-13"/>
<core name="statistics-13_shard1_replica2" instanceDir="statistics-13_shard1_replica2" shard="shard1" collection="statistics-13"/>
<core numShards="2" name="statistics-13_shard2_replica1" instanceDir="statistics-13_shard2_replica1" shard="shard2" collection="statistics-13"/>
</cores>
</solr>
On Solr 4.5 the response doesn't have the save tag.
On Solr 4.5 the command is not saved when executed, only if after is executed other command.