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