API - Upload or update your opensolr configuration files

Config Files

Uploads one configuration file to your Opensolr Index, such as schema.xml or synonyms.txt. A file with the same name is replaced.

Endpointhttps://opensolr.com/solr_manager/api/upload_config_file
MethodPOST, multipart/form-data
Authemail and api_key of your account, as GET or POST parameters: Authentication.

01 · Parameters

core_nameRequired

The name of your index.

userfileRequired

The file. Its name on your disk is the name it gets on the index. Accepted: .xml, .txt, .zip, .aff, .dic.

02 · Example

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

03 · Answer

status is true and msg holds the answer of the server, which reloads the index with the new file. When Solr cannot load the file, msg carries its error.

Many files at once, or a whole configuration: upload_zip_config_files.

04 · Errors

ERROR_NOT_CORE_OWNERHTTP 200

The index is not yours.

errorHTTP 200

In msg, when the upload itself failed, for example a file type that is not accepted.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds: Rate limits.

05 · Related

Read a file back: get_file. List the files: get_all_config_files. Delete one: delete_config_file.

What each file does: The configuration files.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.