title: Lucene Indexing Performance
body: <p>I have written a program to index database data to disk and I am not sure if my indexing speed is appropriate i.e. if I am very slow or not and if speed can be further improved. </p>
  
  <p>Speed that I get is around 15000 Documents per Hour which amounts to around 2600 KB of Index Directory Size for creation of new indices. </p>
  
  <p>I am using Lucene 6.0.0 and Windows 8.1 64 bit OS, 16 GB RAM and Intel Core i7 8 Core machine. I am doing indexing on local machine and not sure what kind of disks I have, its the usual one that comes with Windows PC. </p>
  
  <p>I am using Spring Batch to <code>INNER JOIN</code> two database tables and get a Row Mapped Object from <code>ItemReader</code> then I prepare <code>Document</code> from this object. </p>
  
  <p>I am always using method, <code>writer.updateDocument(contentDuplicateKeyTerm, doc);</code>  and not <code>addDocument(doc)</code> since in Lucene 6.0.0 <code>updateDocument</code> adds a document to index if document doesn't already exist in addition to updating existing document. </p>
  
  <p>I am not aware of any bench mark to compare my program to. </p>
  
  <p>Please suggest. </p>
  
  <p><strong>EDIT:</strong>  Now, I am able to achieve performance of around 1,80,000 documents per hour. Issue was doing <code>IndexWriter.commit()</code> after updating each <code>Document</code>, now I commit at regular intervals and that has improved performance greatly.</p>