17 Jul 2012 11:26
Can not use custom weight scheme with python binding
piglei <piglei2007 <at> gmail.com>
2012-07-17 09:26:49 GMT
2012-07-17 09:26:49 GMT
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.
RSS Feed