title: What is the difference between commit and flush for IndexWriter in Lucene
body: <p>What is the difference between commit and flush for IndexWriter in Lucene?</p>
  
  <p>Here is the documentation for the class but it is unclear to me what is the difference between the 2 methods is:</p>
  
  <p><a href="https://lucene.apache.org/core/4_5_0/core/org/apache/lucene/index/IndexWriter.html" rel="noreferrer">https://lucene.apache.org/core/4_5_0/core/org/apache/lucene/index/IndexWriter.html</a></p>