Shubham Yelikar
Shubham Yelikar

Reputation: 93

How can I query across multiple collections using SolrCloud?

Is there any way to search for particular value in all available collections in SolrCloud?

ex.I have 5 collections collection_1,collection_2,collection_3,collection_4,collection_5

each collection has common field 'app_id', I want to search all documents for 'app_id:123' on all of these collections. Is there any way to do this?

Upvotes: 1

Views: 351

Answers (1)

MatsLindh
MatsLindh

Reputation: 52792

You can use CREATEALIAS command to create a collection alias that query all five collections as the same time:

/admin/collections?action=CREATEALIAS&name=collection_all&collections=collection_1,collection_2,collection_3,collection_4,collection_5

You can then query this meta-collection in the same way as you'd query any collection.

Upvotes: 3

Related Questions