8

Apache Solr is configured by default to have a certain delay (in my case 2 minutes) before indexing content. I've seen in other posts how to reduce this, but I'm having trouble understanding why you would want a delay in the first place? What would be the downsides of reducing the delay to 0?

1 Answers1

7

It's waiting for more content.

When Solr runs a commit operation to bring more documents into the index, it needs to tear down its existing searcher core and start up a new one. This is a resource intensive operation, and destroys all of the old searcher's caches (and re-runs its cache warming process). If you're doing your updates in a number of different requests, it's less than ideal to spin a new searcher (potentially dozens of times in a few seconds, depending on how you're doing your document additions), slowing down the document updates and trashing the performance of any search queries that come in during that time.

The <autoCommit> settings in your solrconfig.xml govern the delay, or you can override it completely and commit instantly by adding ?commit=true to the URL of your HTTP POST to the /update URL.

Shane Madden
  • 112,982
  • 12
  • 174
  • 248