On Thursday 07 July 2005 16:06, Dan Armbrust wrote: > 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?
To stop the search from a HitCollector just throw an IOException or an Error and catch it where the search was started. Since most searching in Lucene already throws IOException you might try and use a subclass of IOException for the time out. Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]