[Xapian-discuss] how can i search and add document at same time

James Aylett james-xapian at tartarus.org
Wed Sep 9 10:25:41 BST 2009


On Wed, Sep 09, 2009 at 05:06:15PM +0800, ouwind wrote:

> sorry. i mean i has two threads, one thread is adding document to
> the xapian database. another threads is searching the database.both
> use m_indexdb.(Xapian::WritableDatabase* m_indexdb;). so it will
> have exception

Right. Well, the second thread could open a read-only handle to the
database; you can't share Xapian objects between threads in general
(noted in <http://xapian.org/docs/overview.html>). You could manage
shared access yourself as an alternative.

Which makes sense in your case will depend on your application.

J

-- 
  James Aylett

  talktorex.co.uk - xapian.org - uncertaintydivision.org



More information about the Xapian-discuss mailing list