lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: IndexWriter commit
Date Mon, 15 Sep 2008 18:48:32 GMT

There is no difference, unless your computer/OS crashes or loses power  
shortly after you had call the method.

In that case, there's a big difference: commit() guarantees your index  
will be intact (assuming the storage system holding your index was not  
damaged) but with flush(), which doesn't sync() the index files it  
writes, it's entirely possible that the index will become corrupt  
because some files were still in the OS's write cache when it crashed.

But the guarantee only holds if the underlying storage system is  
"honest" about fsync(), ie, it truly flushes all written bytes for  
that file to disk before returning.


Cam Bazz wrote:

> Hello,
> What is the difference between flush in <2.4 and commit?
> Also I have been looking over docs, and they mention commit(long) but
> there is no commit(long) method but only commit()
> Best.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message