Question

Using solrcloud 4.6, let's say I have a 8 node cluster with a shard running on each node and many different collections. Basically a collections is made each day (to partition the data). Now the question is how to search all of the collection without knowing their names?

The wiki says I can do this:

http://localhost:8983/solr/collection1/select?collection=collection1_NY,collection1_NJ,collection1_CT

which is basically searching multiple collections at the same time. But in my case collections are dynamically created and I don't know the current names.

Is there a way to send a generic search query that hits all the collections?

Or a way to specify a range of collections like collection1-10 or collection*2013?

I also know I can hook into the ZK and get the info but that would be too advanced for what I'm doing.

Was it helpful?

Solution

This should be done with SOLR-5466 (EDIT this is done as of 4.8), but has no patch ready yet...

In this question on the mailing list two workarounds are given, both retrieving the info from zookeeper, via api call or parsing html response to a get.

Here are the two workarounds:

  1. ZK client API you could just do a get_children on the zk node /collections/ to get all collections.

  2. without ZK client API point this url at your solrCloud install

    href="http://host:port/solr/zookeeper?detail=true&path=%2Fcollections

you should be looking for children under the collections node.

OTHER TIPS

To my knowledge you need to know something about the collections and you create alias for a group of collections. You can do something like this:

http://localhost:8983/solr/admin/collections?action=CREATEALIAS&name=AliasName&collection=ListOfCollections

More on this topic:http://blog.cloudera.com/blog/2013/10/collection-aliasing-near-real-time-search-for-really-big-data/

I found the list of collections by requesting:

http://localhost:8983/solr/admin/collections?action=LIST

My Solr version is: 8.7.0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top