lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Buliani <>
Subject problem with IndexSearcher
Date Tue, 14 Jun 2005 11:29:24 GMT
I'm currently using Lucene on a java web site; I've a class containing a
synchronized method that runs all the update on the index, this class
also contains a method (not synchronized) called getSearcher which
returns an IndexSearcher object.

I'm using the singleton pattern for this class so there can be only one
When I update the index I close() the IndexSearcher object in the class,
run the update then create a new IndexSearcher.

This is my problem:
I add a document to the index and search for I can find it.
If I remove the document and search for it again it doesn't find
anything (correct behaviour).
If I add again the same document to the index I can't find it until I
restart the application server (I should be able to find it).

I've noticed that if I create a new IndexSearcher every time they call
the method getSearcher instead of returning the one already instanced it
works fine, that's strange because I create a new IndexSearcher every
time I run the synchronized update method.
Any suggestion?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message