Commit, optimize, and rollback the transaction log

Data sent to Solr is not immediately searchable, nor do deletions take immediate effect. Like a database, changes must be committed. There are two types of commits:

  • Hard commit: This is expensive because it pushes the changes to the filesystem (making them persistent) and has a significant performance impact. This is performed by the <autoCommit> option in solrconfig.xml or by adding commit=true request parameter to a Solr update URL.
  • Soft commit: This is less expensive but is not persistent. This is performed by the <autoSoftCommit> option in solrconfig.xml or using the softCommit=true option along with the commit parameter or by using the commitWithin parameter.

The request to Solr could be the ...

Get Apache Solr Enterprise Search Server - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.