SolrClient.Collections module

Solr Collections api interface.

class SolrClient.Collections(solr, log)

Provides an interface to Solr Collections API.

api(action, args=None)

Sends a request to Solr Collections API. Documentation is here:

  • action (string) – Name of the collection for the action
  • args (dict) – Dictionary of specific parameters for action
check_status(ignore=(), status=None)
Checks status of each collection and shard to make sure that:
  1. Cluster state is active
  2. Number of docs matches across replicas for a given shard.

Returns a dict of results for custom alerting.


Returns raw output of the clusterstatus api command.


Returns a slightly slimmed down version of the clusterstatus api command. It also gets count of documents in each shard on each replica and returns it as doc_count key for each replica.

create(name, numShards, params=None)

Create a new collection.


Return True if a collection exists.


Returns a list[string] of all collection names on the cluster.