lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
Subject Re: no segments* file found: files: Error on opening index
Date Wed, 29 Apr 2009 09:53:04 GMT
Michael McCandless wrote:
> Lucene doesn't have anything builtin to handle this.
>
> It's probably best to put synchronization into your code in such a
> case?  It's presumably also not great if your IndexReader opens an
> empty index since searches will find no results.  Ie, you should
> probably only reopen the IndexReader after all docs have been
> reindexed?
>
> Or you could catch a failure to open the IndexReader and retry, but
> that's not great since differentiating a true failure isn't easy.
>
> Mike
>
>   
I can synchronize the reindex method but I dont think that will help 
because the problem is with the readers, the trouble is that I have 
various threads, and sometimes IndexReaders are being opened in reponse 
to something done on the GUI, without being aware that a reindex is 
being done. I think I need to get any IndexReader opens to wait for any 
reindexing to complete using something in the Concurrent Package. Or 
alternatively I was wondering if the reindex could be done on a 
different folder, so Indexreaders opened in the meantime work on the old 
index, than once the reindexd has completed I can swap the directory 
that the reader looks at to the new one.


Which do you think would work ?
Paul

---------------------------------------------------------------------
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