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: Reopening an index reader still giving me deleted records ?
Date Mon, 07 Nov 2011 20:35:26 GMT
On 07/11/2011 17:45, Michael McCandless wrote:
> How did you open the first IndexReader (is this an NRT reader or a
> "normal" (via IndexReader.open) reader?)?
Hi, its a normal index reader , I create an Index searcher from a directory

IndexSearcher indexSearcher = new IndexSearcher(directory);

and then the reader comes from

indexSearcher.getReader()


>
> Also, be careful with threads: I think your code isn't thread-safe
> because one thread can finish getIndexSearcher() but not yet incRef'd
> the reader, when another thread closes that reader.
>
>
You are probably correct here, Im going to rewrite the code when Lucene 
3.5 is available, but Im firefighting live code at the moment, so Im 
making minimum code changes.
We only reload indexes every three hours so I dont know how much of a 
problem it is, would it/could it explain why Im still getting deleted 
records I cant understand how that would hapen

The key classes are:

http://svn.musicbrainz.org/search_server/trunk/servlet/src/main/java/org/musicbrainz/search/servlet/SearchServer.java

and

http://svn.musicbrainz.org/search_server/trunk/servlet/src/main/java/org/musicbrainz/search/servlet/SearchServlet.java

and

http://svn.musicbrainz.org/search_server/trunk/servlet/src/main/java/org/musicbrainz/search/servlet/ArtistSearch.java

Paul


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message