• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • Python
  • Ubuntu
  • Maven
  • Archived
  • About
Apache Solr | Solr HTTP Admin API: Collections API
  1. Notes
  2. List Collections
  3. Create a Collection
  4. Delete a Collection
  5. Reload a Collection

  1. Notes
    See this page for more details about the Collections API:
    https://lucene.apache.org/solr/guide/8_5/collections-api.html
  2. List Collections
    • HTTP Request (URL):
      http://localhost:8983/solr/admin/collections?action=List&omitHeader=true&wt=xml&indent=true

      These parameters can be added to the request:
      • omitHeader=true|false

      • wt=json|xml

      • indent=true|false

    • Java sample:
  3. Create a Collection
    Create a collection (2 shards, 2 replicas), using an existing configuration directory in ZooKeeper ("_default").
    Assuming you have at least 2 Solr instances up and running.

    • HTTP Request (URL):
      http://localhost:8983/solr/admin/collections?action=CREATE&name=collection1&numShards=2&replicationFactor=2&maxShardsPerNode=2&collection.configName=_default

      Output:

    • Java sample:
  4. Delete a Collection
    You will get an error if you try to delete a collection that is part of aliases.
    You have, first, to delete those aliases (or remove the collection from them) to be able to delete the collection.

    • HTTP Request (URL):
      http://localhost:8983/solr/admin/collections?action=DELETE&name=collection1

    • Java sample:
  5. Reload a Collection
    The "RELOAD" action can be used if you the change the collection configuration in ZooKeeper.

    • HTTP Request (URL):
      http://localhost:8983/solr/admin/collections?action=RELOAD&name=collection1

    • Java sample:
© 2025  mtitek