The IndexWriter javadocs describe it pretty well: http://lucene.apache.org/core/4_5_0/core/org/apache/lucene/index/IndexWriter.html#prepareCommit()
My limited understanding is that new segments are opened on indexing requests if prepareCommit has already been called and/or the segments are ready to be flushed to disk i.e. ramBuffer is full. Why is it this way? This is because all files in a Lucene index are write-once so it must create new files for indexing requests. You may have better luck asking on the java-user mailing list since this is more Lucene territory than Solr. On Tue, Oct 15, 2013 at 4:38 AM, Phani Chaitanya <pvempaty....@gmail.com>wrote: > Hi all, > > I'd like to know a bit more in detail about what is happening behind the > scenes in case of prepareCommit vs Commit. > > Also, I read some where in the comments of the lucene/solr code (I don't > rememebr, but I'll try to dig it) that if a indexing request comes while > commit is requested, it opens a new segment for the indexing and commit > happens as usual. So, the question is when would a new segment be opened > for > indexing ? Is it part of prepareCommit/Commit ? If so, why ? > > Thanks. > > > > ----- > Phani Chaitanya > -- > View this message in context: > http://lucene.472066.n3.nabble.com/prepareCommit-vs-Commit-tp4095545.html > Sent from the Solr - User mailing list archive at Nabble.com. > -- Regards, Shalin Shekhar Mangar.