Reputation: 11
I want to edit solrconfig.xml to enable Solr SpellCheck.(Using solr cloud) I already do this via zookeper on the server, but I want to implement this in my Java code.
Is there any idea how to update/add solrconfig.xml on Solr Cloud with Java? Thanks
Upvotes: 1
Views: 135
Reputation: 8678
You can try the below code to upload the configs.
public void uploadConfig(String confName, File confDir) throws IOException {
SolrZkClient zkClient = new SolrZkClient(zkConnectString, 30000, 30000,
new OnReconnect() {
@Override
public void command() {
}
});
new ZkConfigManager(zkClient).uploadConfigDir(confDir.toPath(), confName);
zkClient.close();
}
Upvotes: 0