lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Updating an index??
Date Thu, 18 Sep 2008 10:06:51 GMT

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.


chaiguy1337 wrote:

> Hi all. I'm new to Lucene, reading Lucene in Action, and using  
> Lucene.NET,
> but my question is not platform specific.
> I'm baffled about the "create" parameter of the IndexWriter/ 
> IndexModifier
> constructor. It seems the only two options are overwrite and fail. I  
> would
> like to append a not-yet-existing database each time I open the  
> IndexWriter.
> In other words, the first time the user runs my program, the index is
> clearly not going to exist, but every successive time the method is  
> called,
> I want it to append the index, not overwrite it!
> It seems to me the only possible way this design could work is if it  
> were
> also coupled with some way to determine if the index already exists.
> Am I totally missing something? Is the append option even supported?  
> Perhaps
> I'm expected to create a new index each time, for every single  
> document (my
> documents are indexed one at a time because they are indexed as soon  
> as they
> are created) and then merge them into the main index? That seems  
> silly when
> a single operation could take care of everything.
> Some light shed on this would be appreciated.
> -- 
> View this message in context:
> Sent from the Lucene - General mailing list archive at

View raw message