On 4/17/2013 7:07 PM, Jie Sun wrote: > thanks Shawn for filing the issue. > > by the way my solrconfig.xml has: > > <dataDir>${MYSOLRROOT:/mysolrroot}/messages/solr/data/${solr.core.name}</dataDir> > > For now I will have to shutdown solr and write a script to modify the > solr.xml manually and rename the core data directory to new one. > > by the way when I try to remove a core using unload (I am using solr 3.5): > > .../solr/admin/cores?action=UNLOAD&core=4130&deleteIndex=true > > it removes the core from solr.xml, but it leaves the data directory '413', > but the index subfolder under 413 is removed, however there are > spellchecker1 and spellchecker2 still remain.
The dataDir option you have in solrconfig.xml completely explains why this is happening. One detail regarding RENAME and SWAP is that the 'solr.core.name' property is never updated unless you completely restart Solr. I have closed the SOLR-4372 as invalid. This is not a bug, it's a side-effect of how the CoreAdmin API works. For RENAME and SWAP to work correctly through a Solr restart, you will need to include the dataDir option in all your core definitions in solr.xml and remove it from solrconfig.xml. If dataDir is specified in solr.xml, then the correct dataDir will be associated with the correct core after restart. You won't be able to use solr.core.name in your dataDir tags, because that doesn't exist at the solr.xml level, and even if it did exist, it would be wrong after a restart, and you would have the same problem you're having now. When you rename a core, it will always retain the old dataDir. I am pretty sure there is no way to fix this, but if I'm wrong, I'm sure that someone will let me know. I ran into the problem with solr.core.name in 3.5.0, because my PingRequestHandler enable/disable functionality included this property in the enable filename, and it would always use the old one until Solr was restarted. Solr 4.x solved this problem for me by moving the enable file from the servlet container's current working directory to dataDir. When you use the deleteIndex parameter on a core UNLOAD, the index is all it will delete. Solr 4.0 added deleteDataDir and deleteInstanceDir parameters. http://wiki.apache.org/solr/CoreAdmin#UNLOAD Thanks, Shawn