In many cases, we do not want to trigger the corresponding XML of commit to SOLR on our own, which brings a lot of inconvenience, with the configuration file, SOLR can automatically perform commit indexing under specified conditions. In addition, it allows the front-end retrieval instance to retrieve the latest data without human intervention.
The method is simple: Find the solrconfig. xml file
Find the following line and add the following configuration
View plaincopy to clipboardprint?
- <Updatehandler class = "SOLR. directupdatehandler2">
- <Autocommit>
- <Maxdoss> 10000 </maxdocs>
- <Maxtime> 300000 </maxtime>
- </Autocommit>
Note:
- Maxdocs: when the number of memory indexes reaches the specified value, dump the memory index to the hard disk and notify the searcher class to load the new index.
- Maxtime: The index data in the commit memory is automatically generated every specified time period, and the searcher class is notified to load new indexes.
- The above two methods are subject to the first fulfillment of the conditions.