piglei
2012-Jul-17 09:26 UTC
[Xapian-discuss] Can not use custom weight scheme with python binding
Hi, I'm trying to use custom weight with python binding.
My test code is like this.
class TinkerWeight(xapian.Weight):
def __init__(self):
pass
def name(self):
return "Tinker"
def serialize(self):
return ""
def get_sumpart(*args):
return 1
def get_maxpart(*args):
return 1
def get_sumextra(*args):
return 0
def get_maxextra(*args):
return 0
... ...
enquire.set_weighting_scheme(TinkerWeight())
But is throws this error:
*in method 'Enquire_set_weighting_scheme', argument 2 of type
'Xapian::Weight const &'*
Could anyone help me to solve this? Thanks a lot.
Olly Betts
2012-Jul-17 10:37 UTC
[Xapian-discuss] Can not use custom weight scheme with python binding
On Tue, Jul 17, 2012 at 05:26:49PM +0800, piglei wrote:> Hi, I'm trying to use custom weight with python binding.It's not currently supported. We had concluded it wasn't possible to, but I probably found a way to do it. The story is in this ticket: http://trac.xapian.org/ticket/401> Could anyone help me to solve this? Thanks a lot.As noted in the last comment in #401, this can probably be implemented using the trick described in http://trac.xapian.org/ticket/554 but nobody's yet done that yet. If you want to work on it, a patch would be great. Cheers, Olly