开发者

how to reopen a closed indexWriter in lucene 3.2?

how to reop开发者_如何学Goen a closed indexWriter in lucene 3.2 and how to testify whether an indexWriter is closed?


When we create instance of IndexWriter, we should do like this way

IndexWriterConfig iwc = new IndexWriterConfig(analyzer);   
iwc.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);

If IndexWriterConfig.OpenMode.CREATE_OR_APPEND is used IndexWriter will create a new index if there is not already an index at the provided path and otherwise open the existing index.

The above is from : https://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/IndexWriter.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜