On 4/16/2013 2:02 PM, Jie Sun wrote:
We just tried to use
.../solr/admin/cores?action=RENAME&core=core0&other=core5

to rename a core 'old' to 'new'.

After the request is done, the solr.xml has new core name, and the solr
admin shows the new core name in the list. But the index dir still has the
old name as the directory name. I looked into solr 3.5 code, this is what
the code does.

However, if I bounce tomcat/solr, when solr is started up, it creates new
index dir with 'new', and now of course there is no longer any document
returned if you search the core.

is this a bug? or did I miss anything?

If your solr.xml is missing the 'persistent' attribute on the <solr> tag, or it is set to false, then I can imagine it behaving this way. This must be set to true, or changes that you make with the core admin API will not be written to disk, so they will not survive a restart.

<solr sharedLib="lib" persistent="true">
  <cores adminPath="/admin/cores">

I haven't used the RENAME functionality, but I use the core SWAP feature extensively. I have cores with names like s0live and s0build, but they actually refer to directories with names like s0_0 and s0_1. When they swap, the directory location of the index doesn't change, but it's like I have renamed both of them with each other's name.

Thanks,
Shawn

Reply via email to