lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Problem with updating Index continuously
Date Mon, 20 Oct 2008 09:01:04 GMT

You need to close the old read, only if the newReader is different  
(ie, it was in fact reopened because there were changes in the index).

Not closing the old reader will cause the files it held open to be  
undeletable.

Mike

Cool The Breezer wrote:

> Hi,
>   I have requirement of updating search index and it results in  
> creation of lots of index files as well as size is also getting  
> increased. I create index writer with autocommit true and create false
>
> directory = FSDirectory.getDirectory(indexDir);
> docWriter = new IndexWriter(directory, true, analyzer, false);
>
> The index gets updated in specified period of time. At the end of  
> update, I use following methods to refresh it
>
> IndexReader newReader =  reader.reopen();
> //Old reader is updated
> reader = newReader;
>
> However above steps resulted in creating lots of files.
>
> segments.gen
> segments_c5
> _4t.cfs
> _5i.cfs
> _5v.cfs
> _5w.cfs
>
> And also lots of duplicate entries keep of increasing. In order to  
> avoid duplicate, I have developed a customized method to remove  
> duplicates in index. However still number and size of index gets  
> increased, though actual update is very few.
>
> Appreciate your help on this.
>
> regards,
> RB
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message