[Xapian-discuss] Terminating a Xapian query

Richard Boulton richard at tartarus.org
Fri Sep 25 07:44:04 BST 2009


2009/9/25 Jean-Francois Dockes <jf at dockes.org>

> Hello,
>
> I am looking for a way to cancel a long-running Xapian query (when the user
> gets bored).
>
> Would throwing an exception inside a matchspy or matchdecider work
> (cleanly) ?
>

I don't see any particular reason that it wouldn't work cleanly.

Another option, if you're using the development 1.1 releases, might be to
use a PostingSource which normally returns all documents (with a weight of
zero), but which you can make jump to the end when desired.  Then, AND that
with the query.  This approach would allow you to obtain the results which
had been calculated at the time you aborted.

-- 
Richard


More information about the Xapian-discuss mailing list