Rafael SDM Sierra
2006-Nov-03 21:22 UTC
[Xapian-discuss] Behavior of WritableDatabase against an "add_database"
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.
But, what's happen when I do more "add_database's"?
Like:
<code>
idx = xapian.WritableDatabase()
for i in xrange(1024,1034):
idx.add_database(xapian.remote_open_writable('192.168.0.1',i))
[insert lots of documents]
del idx
</code>
What it does? In my tests it inserted the documents in the last
"add_database", it's true? Or have some miracle load balancing?
Xapian-0.9.8
Python-2.4
FreeBSD-6.0
--
SDM Underlinux
Garimpar.com
--
PEP-8
S? existem 3 tipos de pessoas no mundo, as que sabem contar, e as que n?o
sabem.
CPFL - Compania Piratininga de FALTA de Luz (6 vezes em 5 dias!!)
Olly Betts
2006-Nov-03 22:08 UTC
[Xapian-discuss] Behavior of WritableDatabase against an "add_database"
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