[Xapian-discuss] [Python] Serializing documents

Olly Betts olly at survex.com
Tue Jan 16 01:54:48 GMT 2007


On Mon, Jan 15, 2007 at 04:15:13AM -0800, Rafael SDM Sierra wrote:
> As I can't serialize xapian.Document over cPickle, I was created "XDocument"
> class, with the same properties of xapian.Document (terms, values, position
> lists), but I think that is better send Document as is, it will be more
> faster (or no?)

It's hard to know for sure without trying it, but I'd expect it would be
faster to serialise in C++ if only because you'll have to make more
Xapian API calls from python to do the serialisation from python.

> There are access to the function serialize_document[1] by the xapian
> bindings?

No, it's internal to the library (at the moment at least).

I've thought before that it might be nice to provide serialisation in
the API for all classes where it makes sense (e.g. it does for Query and
Document, but probably doesn't for Database) especially since we already
have the code for many of them for implementing the remote backend.
Being able to store serialised Query objects would be useful for an
alerting system for example.

Cheers,
    Olly



More information about the Xapian-discuss mailing list