medoc writes

There are currently some cases where long searches cannot be interrupted in the GUI, because the program is executing Xapian code which has no provision for cancellation. It would be nice if a Xapian patch could be proposed to fix this.

Have a look at Xapian code to see if I could find reasonably easy points where to call a cancellation check routine (which would be set on the database object). We can’t use a matchspy because it won’t do anything in the case where there are few candidate documents (ie: uncommon phrase of common terms)