You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jie Sun <js...@yahoo.com> on 2013/05/13 19:46:51 UTC

Re: rename a core to same name of existing core

did any one verified the following is ture?
> the Description on http://wiki.apache.org/solr/CoreAdmin#CREATE is:
>
> *quote*
> If a core with the same name exists, while the "new" created core is
> initalizing, the "old" one will continue to accept requests. Once it
> has finished, all new request will go to the "new" core, and the "old"
> core will be unloaded.
> */quote*

step1 - I have a core 'abc' with 30 documents in it:
http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on

<str name="rows">10</str></lst></lst><result name="response" numFound="30"
start="0"><doc>

step2 - then I create a new core with same name 'abc':
http://myhost.com:8080/solr/admin/cores?action=create&name=abc&instanceDir=./

<response><lst name="responseHeader"><int name="status">0</int><int
name="QTime">303</int></lst><str name="core">abc</str><str
name="saved">/mxl/var/solr/solr.xml</str></response>

step3 - I cleared out my browser cache

step4 - I did same query as in step1, got same results (30 documents):
http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on

<str name="rows">10</str></lst></lst><result name="response" numFound="30"
start="0"><doc>

I thought the old core should be unloaded?
did I misunderstand any thing here?

thanks
Jie



--
View this message in context: http://lucene.472066.n3.nabble.com/rename-a-core-to-same-name-of-existing-core-tp3090960p4063008.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: rename a core to same name of existing core

Posted by Jie Sun <js...@yahoo.com>.
thanks for the information, you are right, I was using the same instance dir.

I agree with you, I would like to see an error is I am creating a core with
the name of existing core name.

right now I have to do ping first, and analyze if the returned code is 404
or not.

Jie



--
View this message in context: http://lucene.472066.n3.nabble.com/rename-a-core-to-same-name-of-existing-core-tp3090960p4063047.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: rename a core to same name of existing core

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/13/2013 11:46 AM, Jie Sun wrote:
> did any one verified the following is ture?
>> the Description on http://wiki.apache.org/solr/CoreAdmin#CREATE is:
>>
>> *quote*
>> If a core with the same name exists, while the "new" created core is
>> initalizing, the "old" one will continue to accept requests. Once it
>> has finished, all new request will go to the "new" core, and the "old"
>> core will be unloaded.
>> */quote*
>
> step1 - I have a core 'abc' with 30 documents in it:
> http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on
>
> <str name="rows">10</str></lst></lst><result name="response" numFound="30"
> start="0"><doc>
>
> step2 - then I create a new core with same name 'abc':
> http://myhost.com:8080/solr/admin/cores?action=create&name=abc&instanceDir=./
>
> <response><lst name="responseHeader"><int name="status">0</int><int
> name="QTime">303</int></lst><str name="core">abc</str><str
> name="saved">/mxl/var/solr/solr.xml</str></response>
>
> step3 - I cleared out my browser cache
>
> step4 - I did same query as in step1, got same results (30 documents):
> http://myhost.com:8080/solr/abc/select/?q=type%3Amessage&version=2.2&start=0&rows=10&indent=on
>
> <str name="rows">10</str></lst></lst><result name="response" numFound="30"
> start="0"><doc>
>
> I thought the old core should be unloaded?
> did I misunderstand any thing here?

If the instanceDir value that you are using is different than the 
existing core, then this might be a bug, either in the documentation or 
Solr.  If the instanceDir is the same as the existing core, then it's 
working as designed -- you've created a core with an index that already 
exists.

I personally would like to see core creation fail if the core already 
exists, but others with more authority may disagree.

A workaround would be to CREATE a new core with a different name and 
instanceDir, SWAP them, and then UNLOAD the one you don't need any more, 
optionally deleting it.

Thanks,
Shawn