You can add the autoCommit and autoSoftCommit through Java code while creating the collection. Please refer the below code for the same.
Initialize the value like "collectionName", "solrZKConfigName", "numShards"
etc.
String solrZkHostPort = "10.14.40.11:2181,10.14.40.11:2182,10.14.40.11:2183";
List<String> zk_Hosts = Arrays.asList(solrZkHostPort.split(","));
CloudSolrClient cloudSolrClient = new CloudSolrClient.Builder(zk_Hosts, Optional.empty()).build();
Map<String, String> collectionProperties = new HashMap<>();
collectionProperties.put("solr.autoCommit.maxTime", 10000);
collectionProperties.put("solr.autoSoftCommit.maxTime", 15000);
final CollectionAdminRequest.Create adminRequest = CollectionAdminRequest.Create
.createCollection(collectionName, solrZKConfigName, numShards, numReplicas) .setMaxShardsPerNode(maxShardsPerNode).setProperties(collectionProperties);
CollectionAdminResponse adminResponse = adminRequest.process(cloudSolrClient);
Another alternative option is through Config API
Map<String, String> props= new HashMap<>();
props.put("solr.autoCommit.maxTime", 10000);
props.put("solr.autoSoftCommit.maxTime", 15000);
StringBuilder command = new StringBuilder("{\"set-property\": {");
for (Map.Entry<String, String> entry: props.entrySet())
{
command.append('"').append(entry.getKey()).append('"').append(':');
command.append(entry.getValue()).append(',');
}
command.setLength(command.length()-1); // remove last comma
command.append("}}");
GenericSolrRequest rq = new GenericSolrRequest(SolrRequest.METHOD.POST, "/config", null);
ContentStream content = new ContentStreamBase.StringStream(command.toString());
rq.setContentStreams(Collections.singleton(content));
rq.process(solrClient);