solrj creates an index of about 129776 pieces of data at a time, created by multiple threads, with a maximum of 1w pieces of data processed by each thread. The core code for each thread is as follows.
but after the actual creation of the index, there are only 97878 indexes (the actual number of indexes is different for each execution). After reading the log, there is no error. The index library primary key is the primary key of the database and will not be repeated.
String ip = PropertiesInit.getPropertiesValue("solrCluster.ip");
CloudSolrClient solrServer = new CloudSolrServer(ip);
// :DefaultCollection
solrServer.setDefaultCollection(coreName);
// :SolrInputDocument
Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
// :
for (int i = 0; i < list.size(); iPP) {
newSumPP;
//
docs.add(document);
}
// :
solrServer.add(docs);
// :
UpdateResponse response = solrServer.commit();
System.out.println(": "+newSum+":" + response.getResponse());
solrServer.close();
printed log
configuration file
<autoCommit>
<maxTime>${solr.autoCommit.maxTime:15000}</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<autoSoftCommit>
<maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime>
</autoSoftCommit>