Bhavin Pandya wrote:
What I want to do is:
    if the index file exist, append document
    if the index file does not exist, create a new , empty index file.

Please check Lucene api for IndexReader...

It has one method which u can use before opening IndexWriter..."indexExists(Directory directory)"

Also note that in the unreleased version of Lucene there
are now constructors for IndexWriter (one for String, File
and Directory) that do this exact logic for you.  This was
the fix for JIRA issue LUCENE-301:

    http://issues.apache.org/jira/browse/LUCENE-301

So the next release of Lucene will have this functionality.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to