Configuring the update handler and autoSoftCommit

Steps to configure the update handler.

Configure the solrconfig.xml to use near real-time capabilities in Solr by setting the default high-performance update handler flag.

For example, the Solr configuration file for the Wikipedia demo sets this flag as follows and uncomments the autoSoftCommit element:
<!-- The default high-performance update handler -->
 <updateHandler class="solr.DirectUpdateHandler2">

 . . .


The autoCommit element is removed to prevent hard commits that hit the disk and flush the cache. The soft commit forces uncommitted documents into internal memory. When data is committed, it is immediately available after the commit.

For live indexing only, the autoSoftCommit/maxTime saturates at 1000 ms, any higher value is overridden to limit the maximum time to 1000ms. Live indexing is on when <rt>true</rt> is in solrconfig.xml. DataStax recommends autoSoftCommit/maxTime of 100 ms with live indexing.

The autoSoftCommit element uses the maxTime update handler attribute. The update handler attributes enable near real-time performance and trigger a soft commit of data automatically, so checking synchronization of data to disk is not necessary. This table describes both update handler options.

Attribute Default Description
maxDocs No default Maximum number of documents to add since the last soft commit before automatically triggering a new soft commit.
maxTime 1000 Maximum expired time in milliseconds between the addition of a document and a new, automatically triggered soft commit.

For details about the update handler and modifying solrconfig.xml, see the Solr documentation.

Configuring update performance

If updates take too long and the value of autoSoftCommit is higher than the default (1000ms), reset autoSoftCommit to the default value in the solrconfig.xml file.