lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaiguy1337 <>
Subject Re: Updating an index??
Date Thu, 18 Sep 2008 14:46:56 GMT

Ah I see. Hopefully that will make it into Lucene.NET eventually (it's using
the 2.0 codebase right now), thought it hasn't been updated in a while.

As a followup, I did manage to get it working alright by checking for the
presence of a "segments" file in the directory. Is this reliable? Is there a
recommended way to tell if there is already an index present in the
directory? I also create an empty index at startup if the segments file is
not found, so that my method that creates an IndexWriter normally for
updating can pass 'false' for create, and "segments" seems to be the only
file created when there are no documents in the index.


Michael McCandless-2 wrote:
> The latest versions of Lucene (java) have a constructor for  
> IndexWriter that does not take a boolean create argument, and simply  
> opens for append if the index is already present else creates the index.
> I don't remember exactly which version this was added in, but it was a  
> good while ago.

View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message