Search code examples
solrsolrcloud

What is the default value of solr comiit params?


On a different SO question I have asked to clarify my understanding about different types of solr commits. This is the thread link Understanding the different type of SOLR commits

Now, Basically I want to know what happens underneath solr when I pass commit=true or commit=false with any solr POST request.

commit=true

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/keywords/update/json/docs?commit=true' --data-binary '{ "id": "550148", "keyword": "astle city", "formatted_address": "Auckland, New Zealand", "country_code": "NZ", "region": "Auckland", "place": "Auckland", "lat": "-36.84846", "lng": "174.763332", "update_date": "2015-10-0500: 49: 35", "index": "0", "north": "NULL", "south": "NULL", "east": "NULL", "west": "NULL" }'

commit=false

curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/keywords/update/json/docs?commit=false' --data-binary '{ "id": "550148", "keyword": "astle city", "formatted_address": "Auckland, New Zealand", "country_code": "NZ", "region": "Auckland", "place": "Auckland", "lat": "-36.84846", "lng": "174.763332", "update_date": "2015-10-0500: 49: 35", "index": "0", "north": "NULL", "south": "NULL", "east": "NULL", "west": "NULL" }'

What is the default value of commit params when I don't set it?


Solution

  • As mentioned in the previous answer, have a detailed look to this bit[3] .

    If you pass the "commit" parameter, you are asking for an Hard commit. If you don't, no commit will happen. Until a Searcher is opened , you can not search the documents you indexed. The way to tell Solr to open a Searcher is with a Soft Commit or with an Hard Commit ( open searcher = true ) .

    Until you do a commit, you can not search those docs and potentially you don't even flush them to your Lucene Directory( this depends on your RAMBuffer as well, but it is a different story)

    [3] https://cwiki.apache.org/confluence/display/solr/UpdateHandlers+in+SolrConfig#UpdateHandlersinSolrConfig-commitandsoftCommit