title: Speed up Lucene index building process
body: <p>I'm working on <a href="http://pastebin.com/Rmy1GFhK" rel="nofollow">this class</a> to build a couple of indexes (categories and entries) in Lucene for an old web app (Lucene 2.0, Java 6).</p>
  
  <p>The thing is it takes too long to build the indexes: 10 minutes on Intel i3 for a 50 MB index containing 60000 entries and a 20 MB index containing 10000 categories.</p>
  
  <p>I would like to speed up the process so I don't have to wait an eternity every time I add/edit an entry to have it indexed.</p>
  
  <p>The entries/categories are read from a MySQL database using Hibernate and JDBC driver and, despite the SQL tables being properly indexed, at first I thought this was where the bottleneck was located (I'm performing 20000 MySQL queries in total**). But each query takes less than 1 milliseconds on average, so I guess that's not the case.</p>
  
  <p>Before I set up and run a profiler which may just tell me what I already know, I would like to know if anybody has any straight forward suggestions on how to improve the index building performance... Perhaps a more recent version of Lucene or Java 7 would help? Or is it the <a href="http://pastebin.com/Si8Yu1sn" rel="nofollow">Analyzer</a> I'm using?</p>
  
  <p>** <em>(2 per category: the first to find sub-categories for a category and the second to find entries for a category)</em></p>