Jul 172011
Does Lucene allow searching and indexing simultaneously?Yes. However, an IndexReader only searches the index as of the “point in time” that it was opened.
Lucene在用IndexReader打开索引的同时,允许用IndexWriter对该索引进行更新,但是IndexReader只能查询到open索引时所索引的文件或者说Document,要想查询新索引的Document,IndexReader必须调用reopen方法(该方法开销较小)。
IndexReader.isCurrent() 方法可以用于测试索引是否有更新。