Hi,
I think you should use another IndexWriter constructor:
IndexWriter(Directory d, Analyzer a, IndexWriter.MaxFieldLength mfl)
Constructs an IndexWriter for the index in d, first *creating it
if it does not already exist*.
Hope this helps.
Bye
Raf
On Sun, Jan 24, 2010 at 4:48 AM, jc
Think from another approach: You can check whether the index exists or
not by IndexReader.*indexExists
<../../../../org/apache/lucene/index/IndexReader.html#indexExists%28java.io.File%29>*(),
and then determine what you want to do with the IndexWriter constructor.
--
--
Chris Lu
-
I figured it out...but the answer leads to a new question.
The problem was that I was using this constructor:
IndexWriter(Directory d, Analyzer a, boolean create,
IndexWriter.MaxFieldLength mfl)
I passed in false for create, and if there is no index yet, it fails as I
described. As soon as I p
When I try to start my service and construct an IndexWriter, I get this:
java.io.FileNotFoundException: no segments* file found in
org.apache.lucene.store.NIOFSDirectory@/home/jchang/IdeaProjects/index-service_trunk/target/testindexA/index/indexablemaildata:
files: [write.lock]
It is odd. The