Configuration Upload Rules: What Is Accepted and Changed

What is accepted, changed and left out

Upload rules

Every configuration file you put on an Opensolr Index goes through the same check, whichever way it arrives: the browser editor, Upload Config Zip, or the API calls upload_config_file and upload_zip_config_files. This page lists every rule, so you can prepare files that go through unchanged.

01 · An upload never fails because of what a file contains

  • A setting that is not available on Opensolr is replaced with a safe value, or removed together with everything that depends on it, so the index still loads.
  • A file that has no safe form is not written. The other files of the same upload are written as usual.
  • Every change is reported at the end as a warning: in the progress dialog of the control panel, in the editor, and in the warnings array of the API answer.
  • An upload fails only when the request itself is wrong (an index that is not yours, a file type the upload does not take, more than 560 files in a ZIP, a ZIP that cannot be opened), or when Solr cannot load the files. Then you see the error.

02 · Files that are not written

FileWhat happens
solrcore.propertiesNot written. Set the values in solrconfig.xml or use the defaults of the ${property:default} syntax.
configoverlay.jsonNot written.
Any .properties file in a ZIPNot written.
Archives, compiled code, executables, native librariesNot written: .jar, .class, .war, .ear, .jmod, .aar, .dex, .apk, .so, .dll, .dylib, .jnilib, .node, .exe, .msi, .bin, .o, .a, .com, .scr, .zip, .gz, .tgz, .tar, .bz2, .7z, .rar, .xz, .phar. The content is checked too: an archive or a binary under any other name is not written either.
XSLT stylesheets.xsl and .xslt files are not written. Stock Solr configurations ship an xslt folder: it is left out and the rest of the ZIP goes on.
Velocity templates.vm files are not written.
A file that still carries a setting from section 03 after the rewriteNot written. This happens when the setting is in a JSON file, in an XML file that is not well formed, or hidden in entities, where it cannot be rewritten. The warning names the setting.
A schema whose uniqueKey field would have to goNot written. See section 04.

Text files, word lists, dictionaries (.aff, .dic), XML, params.json, .js and .css files are accepted.

03 · What is changed in solrconfig.xml and the other XML files

SettingWhat happens
<dataDir>Removed, with any comment that mentions it. Opensolr sets the data folder of every index.
<jmx>Removed. JMX is not available.
healthcheckFileRemoved from the ping handler. The ping handler keeps working.
<updateLog> dirSet to ${solr.ulog.dir:}. A dir of ${solr.ulog.dir:} or ${solr.data.dir:} is kept as written; a dir attribute is removed.
Script update processorsStatelessScriptUpdateProcessorFactory and ScriptUpdateProcessorFactory are removed, and taken out of every processor list that names them. An update chain left with no processor is removed, with every update.chain setting that names it.
Listeners that run programsRunExecutableListener is removed.
Admin handlersKept only under their standard names: PropertiesRequestHandler as /admin/properties, LoggingHandler as /admin/logging, ThreadDumpHandler as /admin/threads, AdminHandlers as /admin/ or /admin. Under any other name the handler is removed.
Replication, stream, SQL and graph handlersKept only as /replication, /stream, /sql and /graph. Under any other name the handler is removed.
Replication follower (slave) sectionKept when its leaderUrl or masterUrl names one of your own Opensolr indexes. Otherwise the whole follower section is removed and /replication keeps working as a leader. A follower section switched off with enable set to false is removed without a warning, since it changes nothing. A leaderUrl or masterUrl outside a follower section that names another index removes the replication handler.
shards, shard.urlKept when every address in the list is one of your own Opensolr indexes. Otherwise the parameter is removed and the handler searches its own index.
fromIndexEvery setting with a join across indexes (fromIndex= in local parameters, "fromIndex": in the JSON query syntax, a fromIndex parameter) is removed.
fetchindexA setting that runs the fetchindex command is removed.
XSLT elementsRemoved.
Search componentsA removed component is also taken out of the components, first-components and last-components lists of the handlers.
localhost, 127.0.0.1Replaced with INVALID_HOSTNAME, in every file and anywhere in it.
buildOnCommit, buildOnOptimizeSet to false in every XML file, so suggesters and spellcheckers are not rebuilt on every commit. Build them when you need with suggest.build=true or spellcheck.build=true.
LRUCache, FastLRUCache, LFUCacheOn Solr 8.3 and newer they become solr.CaffeineCache, with the same attributes. Done in the editor and in a single file upload, not in a ZIP.
Infix suggestersAn AnalyzingInfixLookupFactory or BlendedInfixLookupFactory suggester with no indexPath, or with the same one as another suggester, gets its own: ./ followed by the suggester name. Done in the editor and in a single file upload, not in a ZIP.

An address of your own index, for replication or shards: http or https, the Opensolr host name of the index, no port or port 80 or 443, the path /solr/ followed by the index name (and /replication if you like), no query string. On a cluster, Opensolr sets up replication between the master and the replicas for you.

The last four rows are not listed in the warnings. All the others are.

04 · Files a configuration reads

Every file a configuration names must be inside the configuration folder of the index: a plain relative name such as synonyms.txt. These are refused: a path that starts with / or \, a path with .., an address such as http: or file:, and ${...} inside a path. A value that is only a property, such as ${synonyms.file}, is fine. The NLP model files Opensolr provides are the one exception to the absolute path rule.

The rule covers these attributes and <str name="..."> settings: synonyms, words, protected, dictionary, stopwords, mapping, file, resource, enumsConfig, currencyConfig, dict, affix, types, tokenizerModel, sentenceModel, posTaggerModel, chunkerModel, nerTaggerModel, lemmatizerModel, lemmatizerDictionary, hyphenator, encoder, spellcheckIndexDir, sourceLocation, config.

Where the file is namedWhat happens
A filter or char filterThe filter is removed from the analyzer.
A tokenizerReplaced with solr.StandardTokenizerFactory, so the analyzer stays valid.
A field typeThe field type is removed, with the fields and dynamic fields that use it and their copyFields. If the uniqueKey field would go with it, the schema file is not written at all.
Any other settingThe setting is removed.
xi:includeAn include whose href leaves the configuration folder is removed.
External XML entityAn entity whose file leaves the configuration folder is emptied. Include sibling files by their bare name, for example <!ENTITY extra SYSTEM "schema_extra_types.xml">.

05 · File names and where files go

  • Name every file name.extension, with one dot. Use letters, digits, _ and -; any other character becomes _. With an upload, the name ends at the first dot and the extension at the second: synonyms.en.txt would be saved as synonyms.en.
  • .txt files are saved twice, in the configuration folder and in its lang folder, so both stopwords_en.txt and lang/stopwords_en.txt work in a schema.
  • .css, .html and .htm files go to the velocity folder.
  • Every other file goes to the configuration folder itself. Folders inside a ZIP are not kept.
  • A file with the same name as an existing one replaces it.

06 · Limits

WayLimits
Editor1,895,000 characters per file. A larger file is not sent: “ERROR: File too large.”
One file by API.xml, .txt, .aff and .dic. A .zip is taken by the upload but not written: send it to upload_zip_config_files. Up to 128 MB per request.
ZIP, panel or APIOne .zip of up to 128 MB. At most 560 files, or the whole upload is refused with ERROR_PLEASE_UPLOAD_MAX_560_FILES. Each file must be smaller than 500 KB: a larger file is left out without a warning. How to build the archive: Upload a ZIP.

07 · Reading the warnings

Each warning starts with the file name, then says what was done and why. Some of them:

solrconfig.xml: <jmx> was removed: JMX is not available on Opensolr.
solrconfig.xml: the updateLog dir was set to ${solr.ulog.dir:}: the transaction log of an index is kept where Opensolr puts it.
solrconfig.xml: the replication slave section was removed: its masterUrl may only name one of your own indexes.
solrconfig.xml: the update chain "script" was removed: it had no processor left.
schema.xml: the field type "text_custom" was removed, with the fields that use it: the file "/etc/words.txt" must be inside the configuration folder.
solrcore.properties: was not saved: .properties files are not accepted in an index configuration.
  • In the control panel the progress dialog lists them under Warnings and stays open until you close it. The editor also shows “File saved, with warnings”.
  • In the API answer they are the warnings array, missing when nothing was changed.
  • A warning is not an error: the index was saved and reloaded. Fix the file on your side so the next upload goes through unchanged, and open the file in the editor to see what the index runs now.

08 · Text extraction (Tika)

These rules do not touch the extraction handler. Tika is not present in every region: to have it enabled for your index and region, contact Opensolr support.