API - Upload or update your opensolr configuration files

Config Files
API Endpoint

Upload Configuration File

Upload or update a single Solr configuration file on your Opensolr index. Use this to automate the deployment of individual config files like schema.xml or solrconfig.xml.

Endpoint

POST https://opensolr.com/solr_manager/api/upload_config_file

Parameters

ParameterStatusDescription
emailrequiredYour Opensolr registration email address
api_keyrequiredYour Opensolr API key
core_namerequiredThe name of your Opensolr index
userfilerequiredThe configuration file to upload (sent as multipart form data). The file name on the server will match the uploaded file name.

Code Examples

cURL

curl -X POST https://opensolr.com/solr_manager/api/upload_config_file \
  -F "email=YOUR_EMAIL" \
  -F "api_key=YOUR_API_KEY" \
  -F "core_name=YOUR_INDEX" \
  -F "userfile=@/path/to/schema.xml"

PHP

$ch = curl_init('https://opensolr.com/solr_manager/api/upload_config_file');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS     => [
        'email'     => 'YOUR_EMAIL',
        'api_key'   => 'YOUR_API_KEY',
        'core_name' => 'YOUR_INDEX',
        'userfile'  => new CURLFile('/path/to/schema.xml'),
    ],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);

Python

import requests

with open("/path/to/schema.xml", "rb") as f:
    response = requests.post(
        "https://opensolr.com/solr_manager/api/upload_config_file",
        data={
            "email": "YOUR_EMAIL",
            "api_key": "YOUR_API_KEY",
            "core_name": "YOUR_INDEX",
        },
        files={
            "userfile": ("schema.xml", f, "application/xml"),
        }
    )
data = response.json()
print(data)
Tip: After uploading new configuration files, reload your index for the changes to take effect.

Related Documentation

Upload Config Zip

Upload multiple config files at once as a zip archive.

List Config Files

Get a list of all configuration files on your index.

Reload Index

Reload your index to apply configuration changes.

Config File Guide

Understand how Solr configuration files work together.

Need help with your Solr configuration? We can help.

Contact Support