I'd like to put new solrconfig.xml
and schema.xml
using solrj.
I already found SchemaRquest. But, It provides only some functions Add/Update/Delete.
What I want to do is that define solrconfig.xml
and schema.xml
first and put it into a collection and use it using solrj.
Assuming you have a SolrCloud setup you can do this:
$SOLR_HOME/server/scripts/cloud-scripts/zkcli.sh -zkhost zkhost:3181 -confname example-cmd putfile /configs/example/managed-schema ./managed-schema
If you want to do with Java, you can do something like this:
ZooKeeper zk = new ZooKeeper(host, tick * 15, this);
zk.setData(PATH_IN_ZK, contentString.getBytes(StandardCharsets.UTF_8), -1);