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() 方法可以用于测试索引是否有更新。

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

使用腾讯微博登陆

Protected by WP Anti Spam
   
© 2011 Information Retrieval Blog Suffusion theme by Sayontan Sinha