lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <ysee...@gmail.com>
Subject Re: cancel search
Date Thu, 08 Sep 2005 13:08:58 GMT
You could create your own HitCollector that checked a flag on each hit, and 
throw an exception if it was set.
In a separate thread, you could set the flag to cancel the search.

-Yonik
Now hiring -- http://tinyurl.com/7m67g

On 9/8/05, Kunemann Frank <frank.kunemann@innosystec.de> wrote:
> 
> 
> The problem is that when searching there is no real save point to stop
> the thread. The only line that takes time is this one:
> 
> Hits hits = searcher.search(query);
> 
> 
> Frank
> 
> >I've had such a long lasting search too. I sounds good to start the
> >search in another thread. I've done this for the indexing procedure.
> >This is started in another thread and the gui will be informed when
> >indexing is performed. If the user will stop it he has to click on a
> >button stop and then an event is send to the indexerthread. The
> >indexerthread stops if he reaches a safe point. Surely this is for
> >indexing but I think this would work for searching also.
> >stefan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message