You live and learn. :)
Thanks! This really solves the problem.
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 9. September 2005 11:12
An: java-user@lucene.apache.org
Betreff: Re: AW: cancel search
You could always create a subclass of
e your program will exit sometimes. In this
> case no results will be returned.
> That's why I can't use it to cancel the search after a given time or
> amount of documents found. But it's good enough for a cancel-button.
>
> Hope this will help everyone having the sam
erstag, 8. September 2005 15:09
An: java-user@lucene.apache.org
Betreff: Re: cancel search
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:/
That's smart, I really like this idea. :)
Thank you!
Frank
-Ursprüngliche Nachricht-
Von: Yonik Seeley [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 8. September 2005 15:09
An: java-user@lucene.apache.org
Betreff: Re: cancel search
You could create your own HitCollector that ch
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 <[EMAIL PROTECTED]> wrote:
>
>
> The problem
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 <[EMAIL PROTECTED]> wrote:
>
>
> The problem
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 indexin
Kunemann Frank wrote:
>Is there a good way to cancel a search? I mean e.g. after 10 seconds or if the
>user changed his mind and wants to start another query.
>Till now I didn't have a query that took longer than 10 secs, but this can
>happen easily when the network connection is very slow or so
Is there a good way to cancel a search? I mean e.g. after 10 seconds or if the
user changed his mind and wants to start another query.
Till now I didn't have a query that took longer than 10 secs, but this can
happen easily when the network connection is very slow or something like that.
I thou