ConfigSets API

The ConfigSets API enables you to create, delete, and otherwise manage ConfigSets.

To use a ConfigSet created with this API as the configuration for a collection, use the Collections API.

This API can only be used with Solr running in SolrCloud mode. If you are not running Solr in SolrCloud mode but would still like to use shared configurations, please see the section Config Sets.

ConfigSets API Entry Points

The base URL for all API calls is http://<hostname>:<port>/solr.

  • /admin/configs?action=CREATE: create a ConfigSet, based on an existing ConfigSet

  • /admin/configs?action=DELETE: delete a ConfigSet

  • /admin/configs?action=LIST: list all ConfigSets

  • /admin/configs?action=UPLOAD: upload a ConfigSet

Create a ConfigSet

/admin/configs?action=CREATE&name=name&baseConfigSet=baseConfigSet

Create a ConfigSet, based on an existing ConfigSet.

Create ConfigSet Parameters

The following parameters are supported when creating a ConfigSet.

name

The ConfigSet to be created. This parameter is required.

baseConfigSet

The ConfigSet to copy as a base. This parameter is required.

configSetProp.name=value

Any ConfigSet property from base to override.

Create ConfigSet Response

The response will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.

Create ConfigSet Examples

Input

Create a ConfigSet named 'myConfigSet' based on a 'predefinedTemplate' ConfigSet, overriding the immutable property to false.

http://localhost:8983/solr/admin/configs?action=CREATE&name=myConfigSet&baseConfigSet=predefinedTemplate&configSetProp.immutable=false&wt=xml

Output

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">323</int>
  </lst>
</response>

Delete a ConfigSet

/admin/configs?action=DELETE&name=name

Delete a ConfigSet

Delete ConfigSet Parameters

name

The ConfigSet to be deleted. This parameter is required.

Delete ConfigSet Response

The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.

Delete ConfigSet Examples

Input

Delete ConfigSet 'myConfigSet'

http://localhost:8983/solr/admin/configs?action=DELETE&name=myConfigSet&wt=xml

Output

<response>
  <lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">170</int>
  </lst>
</response>

List ConfigSets

/admin/configs?action=LIST

Fetch the names of the ConfigSets in the cluster.

List ConfigSet Examples

Input

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

Output

{
  "responseHeader":{
    "status":0,
    "QTime":203},
  "configSets":["myConfigSet1",
    "myConfig2"]}

Upload a ConfigSet

/admin/configs?action=UPLOAD&name=name

Upload a ConfigSet, sent in as a zipped file. Please note that a ConfigSet is uploaded in a "trusted" mode if authentication is enabled and this upload operation is performed as an authenticated request. Without authentication, a ConfigSet is uploaded in an "untrusted" mode. Upon creation of a collection using an "untrusted" ConfigSet, the following functionality would not work:

  • DataImportHandler’s ScriptTransformer does not initialize, if specified in the ConfigSet.

  • XSLT transformer (tr parameter) cannot be used at request processing time.

  • StatelessScriptUpdateProcessor does not initialize, if specified in the ConfigSet.

Upload ConfigSet Parameters

name

The ConfigSet to be created when the upload is complete. This parameter is required.

The body of the request should contain a zipped config set.

Upload ConfigSet Response

The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.

Upload ConfigSet Examples

Create a config set named 'myConfigSet' from the zipped file myconfigset.zip. The zip file must be created from within the conf directory (i.e., solrconfig.xml must be the top level entry in the zip file). Here is an example on how to create the zip file and upload it:

$ (cd solr/server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) > myconfigset.zip

$ curl -X POST --header "Content-Type:application/octet-stream" --data-binary @myconfigset.zip "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet"

The same can be achieved using a Unix pipe, without creating an intermediate zip file, as follows:

$ (cd server/solr/configsets/sample_techproducts_configs/conf && zip -r - *) | curl -X POST --header "Content-Type:application/octet-stream" --data-binary @- "http://localhost:8983/solr/admin/configs?action=UPLOAD&name=myConfigSet"