[Xapian-discuss] Ruby Bindings

Olly Betts olly at survex.com
Sun Sep 13 13:15:11 BST 2009


On Sat, Sep 12, 2009 at 05:31:52PM +0100, James Aylett wrote:
> On Sat, Sep 12, 2009 at 10:44:49PM +0800, Stuart Hall wrote:
> 
> > I am trying to implement a weight in ruby.

Note that user implemented Weight subclasses are rather limited in 1.0
as they aren't provided with all the statistics which the built-in ones
have access to.  This is addressed in 1.1.

> In 1.0, Weight is only subclassable in Python. You could try
> rebuilding the bindings (you'll need SWIG installed); the code is
> around line 600 in xapian-bindings/xapian.i -- although whether you'll
> have any luck I have no idea.

While there's a conditional for Python there in 1.0, it is actually
commented out so really no different to 1.1.

> In 1.1, this is disabled entirely. I can't find a ticket for this, so
> I don't know what the current discussion is around this.

The problem was that SWIG didn't wrap it properly due to handling of
the private clone method.  It's quite possible that issue is now fixed
in SWIG, and it may not be an issue for 1.1 anyway as the Weight API
has been overhauled.

Cheers,
    Olly



More information about the Xapian-discuss mailing list