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 something like that. > >I thought about starting the search in a thread and stop it if needed. But >this will result in an undefined state and doesn't seem to be a good approach. > >Frank > >-----Ursprüngliche Nachricht----- >Von: Yonik Seeley [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 7. September 2005 16:24 >An: java-user@lucene.apache.org >Cc: Murray Altheim >Betreff: Re: limit return results > >You normally just can't break out of the HitCollector and get meaningful >results. The problem is that you get unordered (or rather index order) >results from a HitCollector, not ordered by score or any sort. To get the >highest 100 docs by score, you normally need to see *all* the hits. > >On 9/6/05, Otis Gospodnetic <[EMAIL PROTECTED]> wrote: > > >>Hello (redirecting to java-user@), >> >>If you want to have more control over scoring and dealing with hits, >>use HitCollector. Then you can break out when you accumulate enough >>results. Note that scores in HitCollector are not normalized as are >>the one coming from IndexSearcher's search(...) methods. >> >>Otis >> >>--- Murray Altheim <[EMAIL PROTECTED]> wrote: >> >> >> >>>Erik Hatcher wrote: >>> >>> >>>>Just access the first 100 Hits - simple as that. >>>> >>>>Erik >>>> >>>> >>>Erik, >>> >>>This question has come up before. For high traffic sites that >>>can't afford to have the search engine accumulating thousands >>>of hits, only to deliver 100, or perhaps just a few, the >>>current approach *seems* like quite a lot of extra processing. >>>Is there some way to have the engine simply stop generating >>>the hit list after it reaches the specified threshold? >>> >>>Thanks, >>> >>>Murray >>> >>> >>> >>>>On Sep 6, 2005, at 7:07 PM, haipeng du wrote: >>>> >>>> >>>> >>>> >>>>>How could I limit returned results. There may huge number of >>>>>documents that >>>>>match my query, but I just want to get the first 100, for example. >>>>>Thanks a lot. >>>>> >>>>>-- >>>>>Haipeng Du >>>>>Software Engineer >>>>>Comphealth, >>>>>Salt Lake City >>>>> >>>>> >>> >>> >>...................................................................... >> >> >>>Murray Altheim >>>http://www.altheim.com/murray/ >>>Strategic and Services Development >>>The Open University Library >>>The Open University, Milton Keynes, Bucks, MK7 6AA, UK >>>. >>> >>>believe that everything is for >>>you until you discover >>>that you are for it >>>"The Robin and the Worm" by Don >>>Marquis. >>> >>>http://www.altheim.com/lit/robnworm.html >>> >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: [EMAIL PROTECTED] >>>For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >>> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > > > > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]