lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Schwartz" <t...@simpleobjects.com>
Subject Re: problem with IndexSearcher
Date Tue, 14 Jun 2005 12:14:08 GMT
It appears you have answered your own question.  The problem seems to be in your code. 
Without seeing it though, how can we help?

Tony Schwartz
tony@simpleobjects.com
"What we need is more cowbell."


> Hi,
> 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
> instance.
> 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?
>
> Regards,
> 	Stefano
>
>
>
>
> ---------------------------------------------------------------------
> 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