API Endpoint
Get Configuration File
Download a specific configuration file from your Opensolr index. Returns the raw file content. Specify the file name and extension separately.
Endpoint
GET https://opensolr.com/solr_manager/api/get_file
Parameters
| Parameter | Status | Description |
|---|---|---|
email | required | Your Opensolr registration email address |
api_key | required | Your Opensolr API key |
index_name | required | The name of your Opensolr index |
file_name | required | The name of the config file to retrieve, without the file extension (e.g. schema) |
file_extension | required | The file extension, without the period (e.g. xml) |
Code Examples
cURL
# Download schema.xml and save to a local file curl -s "https://opensolr.com/solr_manager/api/get_file?email=YOUR_EMAIL&api_key=YOUR_API_KEY&index_name=YOUR_INDEX&file_name=schema&file_extension=xml" -o schema.xml
PHP
$params = http_build_query([ 'email' => 'YOUR_EMAIL', 'api_key' => 'YOUR_API_KEY', 'index_name' => 'YOUR_INDEX', 'file_name' => 'schema', 'file_extension' => 'xml', ]); $content = file_get_contents( 'https://opensolr.com/solr_manager/api/get_file?' . $params ); // Save to local file file_put_contents('schema.xml', $content); echo "File saved to schema.xml\n";
Python
import requests response = requests.get( "https://opensolr.com/solr_manager/api/get_file", params={ "email": "YOUR_EMAIL", "api_key": "YOUR_API_KEY", "index_name": "YOUR_INDEX", "file_name": "schema", "file_extension": "xml", } ) # Save to local file with open("schema.xml", "w") as f: f.write(response.text) print("File saved to schema.xml")
Related Documentation
List Config Files
Get a list of all configuration files on your index.
Upload Config File
Upload or update a single configuration file.
Delete Config File
Delete a configuration file from your index.
Config File Guide
Understand how Solr configuration files work together.
Need help with your Solr configuration? We can help.
Contact Support