[Xapian-discuss] Behavior of WritableDatabase against an "add_database"

Olly Betts olly at survex.com
Fri Nov 3 22:08:29 GMT 2006


On Fri, Nov 03, 2006 at 09:22:14PM +0000, Rafael SDM Sierra wrote:
> Hi, I'm trying the new stable remote writing (and it is working :D), but I
> have a question, I can use:
> <code>
> idx = xapian.WritableDatabase()
> idx.add_database(xapian.remote_open_writable('192.168.0.1',6666))
> [insert the document]
> del idx
> </code>
> 
> And it will work, I can search for the document and it will be return the
> document added.

This isn't expected to work so any behaviour here is accidental and
shouldn't be relied upon!  It's only intended that add_database be
used on Database objects.

This is the way I'd expect the above example to be written:

idx = xapian.remote_open_writable('192.168.0.1',6666)
[insert the document]
del idx

Cheers,
    Olly



More information about the Xapian-discuss mailing list