All Downloads are FREE. Search and download functionalities are using the official Maven repository.

apispec.collections.Commands.json Maven / Gradle / Ivy

There is a newer version: 9.7.0
Show newest version
{
  "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#create",
  "description": "Create collections and collection aliases, backup or restore collections, and delete collections and aliases.",
  "methods": [
    "POST"
  ],
  "url": {
    "paths": [
      "/collections",
      "/c"
    ]
  },
  "commands": {
    "create": {
      "type": "object",
      "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#create",
      "description": "Create a collection.",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the collection to be created."
        },
        "config": {
          "type": "string",
          "description": "The name of the configuration set (which must already be stored in ZooKeeper) to use for this collection. If not provided, Solr will default to the collection name as the configuration set name."
        },
        "router": {
          "type": "object",
          "documentation": "https://lucene.apache.org/solr/guide/shards-and-indexing-data-in-solrcloud.html",
          "description": "These properties define how to distribute documents across a collection's shards.",
          "properties": {
            "name": {
              "type": "string",
              "enum":["implicit","compositeId"],
              "description": "The router implementation to use for this collection. There are two options: compositeId or implicit. The compositeId option has Solr decide how to distribute documents (with some possibilities for customization). The implicit option requires you define your own routing strategy, and puts the balancing of documents in shards entirely in your hands.",
              "default": "compositeId"
            },
            "field": {
              "type": "string",
              "description": "A field to be used by Solr to identify the shard a document should be routed to. By default, the field defined as the unique ID for each document is used, but an alternative field can be defined with this parameter."
            }
          }
        },
        "numShards": {
          "type": "integer",
          "description": "The number of shards to be created as part of the collection. Shards are logical partitions of a single collection. Each shard has at least one replica, but more replicas for each shard can be defined with the replicationFactor property. This is a required parameter when using the 'compositeId' router."
        },
        "shards": {
          "type": "string",
          "description": "A comma-separated list of shard names, e.g., shard-x,shard-y,shard-z. This is a required parameter when using the 'implicit' router."
        },
        "replicationFactor": {
          "type": "integer",
          "description": "The number of NRT replicas to be created for each shard. Replicas are physical copies of each shard, acting as failover for the shard."
        },
        "nrtReplicas": {
          "type": "integer",
          "description": "The number of NRT replicas to be created for each shard. Replicas are physical copies of each shard, acting as failover for the shard. Replicas of type NRT will be updated with each document that is added to the cluster, and can use \"softCommits\" to get a new view of the index in Near Real Time. This parameter works in the same way as 'replicationFactor'"
        },
        "tlogReplicas": {
          "type": "integer",
          "description": "The number of TLOG replicas to be created for each shard. TLOG replicas update their transaction log for every update to the cluster, but only the shard leader updates the local index, other TLOG replicas will use segment replication and copy the latest index files from the leader."
        },
        "pullReplicas": {
          "type": "integer",
          "description": "The number of PULL replicas to be created for each shard. PULL replicas don't receive copies of the documents on update requests, they just replicate the latest segments periodically from the shard leader. PULL replicas can't become shard leaders, and need at least one active TLOG(recommended) or NRT replicas in the shard to replicate from."
        },
        "nodeSet": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Defines nodes to spread the new collection across. If not provided, the collection will be spread across all live Solr nodes. The names to use are the 'node_name', which can be found by a request to the cluster/nodes endpoint. A special value of EMPTY will create no shards or replicas for the new collection. In this case, shards and replicas can be added later with the add-replica command available on the /collections/{collection}/shards endpoint."
        },
        "shuffleNodes": {
          "type": "boolean",
          "description": "Controls whether or not the shard-replicas created for this collection will be assigned to the nodes specified by the nodeSet property in a sequential manner, or if the list of nodes should be shuffled prior to creating individual replicas. A 'false' value makes the results of a collection creation predictable and gives more exact control over the location of the individual shard-replicas, but 'true' can be a better choice for ensuring replicas are distributed evenly across nodes. This property is ignored if nodeSet is not also specified."
        },
        "maxShardsPerNode": {
          "type": "integer",
          "description": "When creating collections, the shards and/or replicas are spread across all available, live, nodes, and two replicas of the same shard will never be on the same node. If a node is not live when the collection is created, it will not get any parts of the new collection, which could lead to too many replicas being created on a single live node. Defining maxShardsPerNode sets a limit on the number of replicas can be spread to each node. If the entire collection can not be fit into the live nodes, no collection will be created at all."
        },
        "autoAddReplicas": {
          "type": "boolean",
          "description": "When set to true, enables auto addition of replicas on shared file systems (such as HDFS). See https://lucene.apache.org/solr/guide/running-solr-on-hdfs.html for more details on settings and overrides.",
          "default": "false"
        },
        "rule": {
          "type": "array",
          "documentation": "https://lucene.apache.org/solr/guide/rule-based-replica-placement.html",
          "description": "Defines rules for where replicas should be located in a cluster.",
          "items": {
            "type": "string"
          }
        },
        "snitch": {
          "type": "array",
          "documentation": "https://lucene.apache.org/solr/guide/rule-based-replica-placement.html",
          "description": "",
          "items": {
            "type": "string"
          }
        },
        "properties": {
          "type": "object",
          "documentation": "https://lucene.apache.org/solr/guide/defining-core-properties.html",
          "description": "Allows adding core.properties for the collection. Some examples of core properties you may want to modify include the config set, the node name, the data directory, among others.",
          "additionalProperties": true
        },
        "async": {
          "type": "string",
          "description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously."
        }
      },
      "required": [
        "name"
      ]
    },
    "create-alias": {
      "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#createalias",
      "description": "Allows one or more collections to be known by another name. If this command is used on an existing alias, the existing alias will be replaced with the new collection details.",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The alias name to be created."
        },
        "collections": {
          "type": "array",
          "description": "The list of collections to be known as this alias.",
          "items": {
            "type": "string"
          }
        },
        "async": {
          "type": "string",
          "description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously."
        }
      },
      "required": [
        "name",
        "collections"
      ]
    },
    "delete-alias": {
      "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#deletealias",
      "description": "Deletes a collection alias",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the alias to delete."
        },
        "async": {
          "type": "string",
          "description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously."
        }
      },
      "required":["name"]
    },
    "backup-collection": {
      "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#backup",
      "description": "Backup Solr indexes and configurations for a specific collection. One copy of the indexes will be taken from each shard, and the config set for the collection will also be copied.",
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The name of the collection to back up."
        },
        "name": {
          "type": "string",
          "description": "The name of the backup."
        },
        "location": {
          "type": "string",
          "description": "A location on a shared drive for the backup-collection command to write to. Alternately, it can be set as a cluster property with the cluster endpoint, which also supports setting a location."
        },
        "async": {
          "type": "string",
          "description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously."
        }
      },
      "required": [
        "collection",
        "name",
        "location"
      ]
    },
    "restore-collection": {
      "documentation": "https://lucene.apache.org/solr/guide/collections-api.html#restore",
      "description": "Restore Solr indexes and configurations from a backup. You cannot restore into the same collection you took the backup from. The target collection must not exist before calling this command, as it will be created by the restore action. The new collection will have the same number of shards and replicas as the original collection, and all routing strategies will be retained.",
      "type": "object",
      "properties": {
        "collection": {
          "type": "string",
          "description": "The name of the collection the backup will be restored to. This collection must not exist prior to this "
        },
        "name": {
          "type": "string",
          "description": "The name of the backup file."
        },
        "location": {
          "type": "string",
          "description": "The location on the shared drive for the restore-collection command to read from. Alternately, it can be set as a cluster property with the cluster endpoint, which also supports setting a location."
        },
        "async": {
          "type": "string",
          "description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously."
        }
      },
      "required": [
        "collection",
        "name",
        "location"
      ]
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy