[Xapian-discuss] search without flush.

Richard Boulton richard at lemurconsulting.com
Fri Jun 5 10:24:29 BST 2009


2009/6/2 Richard Heycock <rgh at roughage.com.au>:
> Is there a way of running a search after I've called add_document but
> before flush is called?

Yes - WritableDatabase is a subclass of Database, so you can pass it
to the Enquire object and use it to conduct a search.  If you do this,
the (possibly unflushed) version of the database accessible via the
WritableDatabase object will be used for the search, which will always
(by definition) contain the latest changes.  Note that you can only
use this from a single thread, though, so if you need concurrent
searches to be possible, you'll probably need to start flushing
faster, as the other responses discuss.

-- 
Richard



More information about the Xapian-discuss mailing list