3

What is the fundamental difference between Add & Commit in Solr? We have read several document, but still now very much clear what it exactly do, and when use Add & when to use Commit ?

As far as I understand, Add adds data into the solr database, and commit updates its index to include new data? But, still not very much clear hence, posting it here to understand it very clearly.

Dharmik Bhandari
  • 1,702
  • 5
  • 29
  • 60

1 Answers1

6

Add will add the document to the Index.
However, the document will not returned as search result unless you commit.
When you are indexing documents to solr none of the changes (add/delete/update) you make will appear until you run the commit command.

A commit operation makes index changes visible to new search requests.

As Commit is an heavy operation (involves opening of Searchers and Auto Warming of caches), you can add documents but should commit in batches.

Jayendra
  • 52,349
  • 4
  • 80
  • 90
  • Okay thank you. So, when I have 200 product updated into main db, I'll update solr data once, and then run commit, so it will update the index. – Dharmik Bhandari Jun 12 '12 at 12:58
  • I've one other solr related question, please have a look at this too.. you might help us out in that too... http://stackoverflow.com/questions/10996295/updating-solr-index-when-product-data-has-changed – Dharmik Bhandari Jun 12 '12 at 13:00