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 bradhill99 <br...@yahoo.com> on 2013/04/06 12:28:09 UTC

Does solr cloud support rename or swap function for collection?

Hi,
We are using solr 4.1 and we create a collection name my_data with 20
shards. 
Our index files are generated by using lucence api every one hour and load
into solr cloud using core admin API.
My problem is, for data generated every one hour, I need to create a new
collection name like my_data_001 and to load the index files under that
collection name. And my_data will be useless and my_data_001 is the latest
data. In order to keep query url unchanged, I need to rename my_data_001 to
my_data, but I can't see any collection API to do the rename or swap like
core admin supports.
How can I do this?

thanks,

Brad



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does solr cloud support rename or swap function for collection?

Posted by thzinc <da...@thzinc.com>.
This is awesome news. I had been looking for the ability to do this with
SolrCloud since 4.0.0-ALPHA. We're on 4.1.0 right now, so this is a great
reason to plan for an upgrade.

Just to be clear, CREATEALIAS both creates and updates an alias, right?



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193p4081660.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does solr cloud support rename or swap function for collection?

Posted by Tim Vaillancourt <ti...@elementspace.com>.
I added a brief description on CREATEALIAS here, feel free to tweak:

http://wiki.apache.org/solr/SolrCloud#Managing_collections_via_the_Collections_API

Tim

On 07/04/13 05:29 PM, Mark Miller wrote:
> It's pretty simple - just as Brad said, it's just
>
> http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=alias&collections=collection1,collection2,…
>
> You also have action=DELETEALIAS
>
> CREATEALIAS will create and update.
>
> For update requests, you only want a 1to1 alias. For read requests, you can map 1to1 or 1toN.
>
> I've also started work on shard level aliases, but I've yet to get back to finishing it.
>
> - Mark
>
> On Apr 7, 2013, at 5:10 PM, Tim Vaillancourt<ti...@elementspace.com>  wrote:
>
>> I aim to use this feature in more in testing soon. I'll be sure to doc what I can.
>>
>> Cheers,
>>
>> Tim
>>
>> On 07/04/13 12:28 PM, Mark Miller wrote:
>>> On Apr 7, 2013, at 9:44 AM, bradhill99<br...@yahoo.com>   wrote:
>>>
>>>> Thanks Mark for this great feature but I suggest you can update the wiki
>>>> too.
>>> Yeah, I've stopped updating the wiki for a while now looking back - paralysis on how to handle versions (I didn't want to do the std 'this applies to 4.1', 'this applied to 4.0' all over the page) and the current likely move to a new Confluence wiki with Docs based on documentation LucidWorks recently donated to the project.
>>>
>>> That's all a lot of work away still I guess.
>>>
>>> I'll try and add some basic doc for this to the SolrCloud wiki page soon.
>>>
>>> - Mark

Re: Does solr cloud support rename or swap function for collection?

Posted by Mark Miller <ma...@gmail.com>.
It's pretty simple - just as Brad said, it's just

http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=alias&collections=collection1,collection2,…

You also have action=DELETEALIAS

CREATEALIAS will create and update.

For update requests, you only want a 1to1 alias. For read requests, you can map 1to1 or 1toN.

I've also started work on shard level aliases, but I've yet to get back to finishing it.

- Mark

On Apr 7, 2013, at 5:10 PM, Tim Vaillancourt <ti...@elementspace.com> wrote:

> I aim to use this feature in more in testing soon. I'll be sure to doc what I can.
> 
> Cheers,
> 
> Tim
> 
> On 07/04/13 12:28 PM, Mark Miller wrote:
>> On Apr 7, 2013, at 9:44 AM, bradhill99<br...@yahoo.com>  wrote:
>> 
>>> Thanks Mark for this great feature but I suggest you can update the wiki
>>> too.
>> 
>> Yeah, I've stopped updating the wiki for a while now looking back - paralysis on how to handle versions (I didn't want to do the std 'this applies to 4.1', 'this applied to 4.0' all over the page) and the current likely move to a new Confluence wiki with Docs based on documentation LucidWorks recently donated to the project.
>> 
>> That's all a lot of work away still I guess.
>> 
>> I'll try and add some basic doc for this to the SolrCloud wiki page soon.
>> 
>> - Mark


Re: Does solr cloud support rename or swap function for collection?

Posted by Tim Vaillancourt <ti...@elementspace.com>.
I aim to use this feature in more in testing soon. I'll be sure to doc 
what I can.

Cheers,

Tim

On 07/04/13 12:28 PM, Mark Miller wrote:
> On Apr 7, 2013, at 9:44 AM, bradhill99<br...@yahoo.com>  wrote:
>
>> Thanks Mark for this great feature but I suggest you can update the wiki
>> too.
>
> Yeah, I've stopped updating the wiki for a while now looking back - paralysis on how to handle versions (I didn't want to do the std 'this applies to 4.1', 'this applied to 4.0' all over the page) and the current likely move to a new Confluence wiki with Docs based on documentation LucidWorks recently donated to the project.
>
> That's all a lot of work away still I guess.
>
> I'll try and add some basic doc for this to the SolrCloud wiki page soon.
>
> - Mark

Re: Does solr cloud support rename or swap function for collection?

Posted by Mark Miller <ma...@gmail.com>.
On Apr 7, 2013, at 9:44 AM, bradhill99 <br...@yahoo.com> wrote:

> Thanks Mark for this great feature but I suggest you can update the wiki
> too.


Yeah, I've stopped updating the wiki for a while now looking back - paralysis on how to handle versions (I didn't want to do the std 'this applies to 4.1', 'this applied to 4.0' all over the page) and the current likely move to a new Confluence wiki with Docs based on documentation LucidWorks recently donated to the project.

That's all a lot of work away still I guess.

I'll try and add some basic doc for this to the SolrCloud wiki page soon.

- Mark

Re: Does solr cloud support rename or swap function for collection?

Posted by Upayavira <uv...@odoko.co.uk>.
Thx, very useful. 

On Sun, Apr 7, 2013, at 02:44 PM, bradhill99 wrote:
> I think the api is :
> http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=alias&collections=collection1,collection2,...
> 
> And you can do query like:
> http://localhost:8983/solr/alias/select?... And it will query collection1
> and collection2.
> 
> I tried it using solr 4.2.1, it works. 
> 
> Thanks Mark for this great feature but I suggest you can update the wiki
> too.
> 
> thanks, 
> 
> Brad
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193p4054343.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does solr cloud support rename or swap function for collection?

Posted by bradhill99 <br...@yahoo.com>.
I think the api is :
http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=alias&collections=collection1,collection2,...

And you can do query like:
http://localhost:8983/solr/alias/select?... And it will query collection1
and collection2.

I tried it using solr 4.2.1, it works. 

Thanks Mark for this great feature but I suggest you can update the wiki
too.

thanks, 

Brad



--
View this message in context: http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193p4054343.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does solr cloud support rename or swap function for collection?

Posted by Upayavira <uv...@odoko.co.uk>.
Mark, have hunted, but not found docs for this feature. Can you point me
at something? It is a very useful feature.

Thx!!

Upayavira

On Sun, Apr 7, 2013, at 12:22 AM, Mark Miller wrote:
> 4.2 and 4.2.1 have collection aliasing (similar to what we had with
> SolrCore aliasing at one point). You can use that to have one url and
> swap the collection search by it by the scenes.
> 
> - Mark
> 
> On Apr 6, 2013, at 6:28 AM, bradhill99 <br...@yahoo.com> wrote:
> 
> > Hi,
> > We are using solr 4.1 and we create a collection name my_data with 20
> > shards. 
> > Our index files are generated by using lucence api every one hour and load
> > into solr cloud using core admin API.
> > My problem is, for data generated every one hour, I need to create a new
> > collection name like my_data_001 and to load the index files under that
> > collection name. And my_data will be useless and my_data_001 is the latest
> > data. In order to keep query url unchanged, I need to rename my_data_001 to
> > my_data, but I can't see any collection API to do the rename or swap like
> > core admin supports.
> > How can I do this?
> > 
> > thanks,
> > 
> > Brad
> > 
> > 
> > 
> > --
> > View this message in context: http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> 

Re: Does solr cloud support rename or swap function for collection?

Posted by Mark Miller <ma...@gmail.com>.
4.2 and 4.2.1 have collection aliasing (similar to what we had with SolrCore aliasing at one point). You can use that to have one url and swap the collection search by it by the scenes.

- Mark

On Apr 6, 2013, at 6:28 AM, bradhill99 <br...@yahoo.com> wrote:

> Hi,
> We are using solr 4.1 and we create a collection name my_data with 20
> shards. 
> Our index files are generated by using lucence api every one hour and load
> into solr cloud using core admin API.
> My problem is, for data generated every one hour, I need to create a new
> collection name like my_data_001 and to load the index files under that
> collection name. And my_data will be useless and my_data_001 is the latest
> data. In order to keep query url unchanged, I need to rename my_data_001 to
> my_data, but I can't see any collection API to do the rename or swap like
> core admin supports.
> How can I do this?
> 
> thanks,
> 
> Brad
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Does-solr-cloud-support-rename-or-swap-function-for-collection-tp4054193.html
> Sent from the Solr - User mailing list archive at Nabble.com.