On 1/5/2018 6:51 AM, André Widhani wrote:
I know I can retrieve the entire schema using Schema API and I can also use
it to manipulate the schema by adding fields etc.
I don't see any way to post an entire schema file back to the Schema API
though ... this is what most REST APIs offer: You retrieve an object,
modify it and send back the entire object.
I could of course loop through all items in the schema, delete them and
re-create ... this sounds more complicated than it should be.
Is there anything I might have missed in the documentation?
I'm not aware of any way to do this with the Schema API. It is designed
to make individual changes, not wholesale replacement, so that a user
doesn't need to understand the full XML syntax for the schema - they can
send JSON-formatted change requests that are easier to understand than
the entire schema.
If you're running SolrCloud, then you can upload an entire schema file
to zookeepeer and reload the collection, which can be done remotely.
If Solr is not in cloud mode, then the only option is to replace the
file on the filesystem and then reload the core(s).
The feature you want would open up the possibility of uploading a bad
schema in the same way that manual edits can. You're free to file an
enhancement issue in Jira, though.
Thanks,
Shawn