nowadays , i've been trying every way to improve the performance of indexing , IndexWriter's close operation is really costly , and the Lucene's doc sugguest to re-use IndexWriter instance , i did it , i kept the indexWriter instance , and give it back to every request thread , But there comes a big problem , i never search the index changes because the index changes is till in the RAM , maybe there's a way to flush all the changes to the stable Storage and this operation don't close the IndexWriter so i could re-use it . am i right at this point ?
there're several point i don't quite understand .. 1, what's the difference between commit and flush ? i thought with these two method , i could see the changes in my Directory without closing IndexWriter . 2, when should i close the writer ? if i use it Singleton(i don't have to worry about the LockObtainException) , and i don't have to worry about the changes because commit and flush would do this , then i don't have to close it any more ...