blob: 96866e172c951fc2170cf0173c40f32a4117035a [file] [log] [blame]
{
"documentation": "https://lucene.apache.org/solr/guide/collection-management.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/collection-management.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 when the number of active replicas falls below the value set for replicationFactor.",
"documentation": "https://lucene.apache.org/solr/guide/solrcloud-autoscaling-auto-add-replicas.html",
"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"
}
},
"policy": {
"type": "string",
"documentation": "https://lucene.apache.org/solr/guide/solrcloud-autoscaling-policy-preferences.html",
"description": "Name of the collection-level policy"
},
"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."
},
"waitForFinalState": {
"type": "boolean",
"description": "If true then request will complete only when all affected replicas become active.",
"default": false
},
"perReplicaState": {
"type": "boolean",
"description": "Use Per replica states",
"default": false
}
},
"required": [
"name"
]
},
"create-alias": {
"documentation": "https://lucene.apache.org/solr/guide/collection-aliasing.html#createalias",
"description": "Allows one or more collections to be known by another name (to include time partitioned collections). 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. Incompatible with any of the routing parameters. Either this parameter or a complete set of routing parameters is required.",
"items": {
"type": "string"
}
},
"router" : {
"type":"object",
"documentation": "https://lucene.apache.org/solr/guide/collection-aliasing.html#createalias",
"description":"Routing specific properties to define a time routed alias. Do not specify 'collections' when creating a time routed alias.",
"properties" : {
"name" : {
"type" : "string",
"description": "The type of routing to perform. Currently only 'time' is supported, and it's required."
},
"field" : {
"type": "string",
"description": "The date field name in incoming documents that is consulted to decide which collection the document should be routed to."
},
"start": {
"type": "string",
"description": "The earliest date/time in a document that may be indexed into this alias. Documents with values less than this will return an error. For time based routing this may be a date math expression."
},
"interval" : {
"type": "string",
"description": "A specification of the width of the interval for each partition collection. For time based routing this should be a date math expression fragment starting with the + character."
},
"maxFutureMs": {
"type": "integer",
"description":"How many milliseconds into the future to accept document. Documents with a value in router.field that is greater than now() + maxFutureMs will be rejected to avoid provisioning too much resources."
},
"preemptiveCreateMath":{
"type": "string",
"description": "If a document arrives with a timestamp that is after the end time of the most recent collection minus this interval, then the next collection will be created asynchronously. Without this setting, collections are created synchronously when required by the document time stamp and thus block the flow of documents until the collection is created (possibly several seconds). Preemptive creation reduces these hiccups. If set to enough time (perhaps an hour or more) then if there are problems creating a collection, this window of time might be enough to take corrective action. However after a successful preemptive creation, the collection is consuming resources without being used, and new documents will tend to be routed through it only to be routed elsewhere. Also, note that router.autoDeleteAge is currently evaluated relative to the date of a newly created collection, and so you may want to increase the delete age by the preemptive window amount so that the oldest collection isn't deleted too soon."
},
"autoDeleteAge": {
"type": "string",
"description": "A date math expressions yielding a time in the past. Collections covering a period of time entirely before this age will be automatically deleted."
},
"maxCardinality": {
"type": "integer",
"description": "The maximum number of categories allowed for this alias."
},
"mustMatch": {
"type": "string",
"description": "A regular expression that the value of the field specified by `router.field` must match before a corresponding collection will be created."
},
"routerList": {
"type": "array",
"description": "A list of router property sets to be used with router type Dimensional[foo,bar] where foo and bar are valid router type names (i.e. time or category). The order must correspond to the type specification in [] in the Dimensional type, so Dimensional[category,time] would require the first set of router properties to be valid for a category routed alias, and the second set to be valid for a time routed alias. In these sets of properties, router.name will be ignored in favor of the type specified in the top level Dimensional[] router.name",
"items": {
"type": "object",
"additionalProperties": true
}
}
}
},
"TZ": {
"type": "string",
"description": "Optional timezone for use with any date math that may exist in other parameters. Defaults to UTC."
},
"create-collection": {
"type": "object",
"documentation": "https://lucene.apache.org/solr/guide/collection-management.html#create",
"description": "The settings to use to create a collection for each new time partition. Most options from the collection create command are available, except for 'name', 'async' and 'waitForFinalState'.",
"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"
]
},
"delete-alias": {
"documentation": "https://lucene.apache.org/solr/guide/collection-aliasing.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"
]
},
"set-alias-property": {
"documentation": "https://lucene.apache.org/solr/guide/collection-aliasing.html#modifyalias",
"description": "Allows changing the properties on an alias. If a key is set with an empty string then it will be removed",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The alias name on which to set properties."
},
"properties" : {
"type": "object",
"description": "A map of key/value pairs that will be associated with the alias as alias properties (metadata). An empty value will delete any existing value for a given key.",
"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"
]
},
"backup-collection": {
"documentation": "https://lucene.apache.org/solr/guide/collection-management.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."
},
"followAliases": {
"type": "boolean",
"description": "Controls whether aliases are resolved when trying to back up the specified collection, or whether Solr should only backup the provided collection name if it matches a concrete collection."
},
"incremental": {
"type": "boolean",
"description": "An internal property that controls whether the backup should use the standard 'incremental' file format or the deprecated 'full-snapshot' based format."
},
"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"
]
},
"restore-collection": {
"documentation": "https://lucene.apache.org/solr/guide/collection-management.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."
},
"backupId": {
"type": "integer",
"description": "The ID of the backup to restore, when the provided location and backup name hold multiple backups for the provided collection. Defaults to the most recent backup if not specified."
},
"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"
]
}
}
}