English 中文(简体)
如何重开Lucene 3.2的封闭指数?
原标题:how to reopen a closed indexWriter in lucene 3.2?
  • 时间:2011-08-10 06:47:33
  •  标签:
  • lucene

how to reopen a closed indexWriter in lucene 3.2 and how to testify whether an indexWriter is closed?

问题回答

当我们创建索引时,我们就应该这样做。

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

如果指数WriterConfig.OpenMode.CREATE_OR_APPEND被使用,那么如果在规定的道路上没有指数,否则就会形成新的指数,以开放现有的指数。

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





相关问题
Lucene.NET in medium trust

How do I make Lucene.NET 2.3.2 run in a medium trust environment? GoDaddy doesn t like it the way it is.

Grails searchable plugin

In my Grails app, I m using the Searchable plugin for searching/indexing. I want to write a Compass/Lucene query that involves multiple domain classes. Within that query when I want to refer to the id ...

Search subset of objects using Compass/Lucene

I m using the searchable plugin for Grails (which provides an API for Compass, which is itself an API over Lucene). I have an Order class that I would like to search but, I don t want to search all ...

Lucene seems to be caching search results - why?

In my project we use Lucene 2.4.1 for fulltext search. This is a J2EE project, IndexSearcher is created once. In the background, the index is refreshed every couple of minutes (when the content ...

热门标签