lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Polites" <jason.poli...@synetek.com>
Subject RE: Search Timeout - abort a search
Date Thu, 07 Jul 2005 23:44:57 GMT
You could do it asynchronously.  That is, separate off the actually
lucene search into a different thread which does the actual search, then
the calling thread simply waits for a maximum time for the search thread
to complete, then queries the status of the search thread to get the
results obtained to that point.  You can then kill the search thread, or
let it run in the background.

-----Original Message-----
From: Dan Armbrust [mailto:daniel.armbrust.list@gmail.com] 
Sent: Friday, 8 July 2005 12:06 AM
To: java-user@lucene.apache.org
Subject: Search Timeout - abort a search

Has anyone ever written code to make it possible to return from a
search, after a given amount of time, returning the results that have
been collected so far (but not necessarily all of them)?

The only thing that I can see to do through the public Lucene API's
would be to do the search using a HitCollector - and just stop recording
the hits after X amount of time has passed - but this would only
partially solve the problem... lucene would still continue to call the
HitCollector collect method until it finished.

Is there something else I'm missing?

Thanks,

Dan

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