I'm trying to call Enquire.set_bias() from the python bindings. This fails as follows:>>> db=xapian.Database('/home/richard/foo') >>> enq=xapian.Enquire(db) >>> enq.set_bias(1.0, 3600)Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: in method 'Enquire_set_bias', argument 3 of type 'time_t' I know that set_bias is a temporary API, but it would be good to be able to use it as it is. Is there some trick that can let this work that I don't know of, or is a fix needed to the bindings? As far as I can tell, the problem is that SWIG doesn't know about the time_t type, and there is no definition of it in the xapian.i file (or the files this pulls in). I tried patching xapian-bindings/xapian.i to make things work on my system, but no luck yet. Any neat ideas, anyone? -- Richard
richard at lemurconsulting.com
2006-Nov-08 16:15 UTC
[Xapian-devel] set_bias() in bindings
Quick follow up - changing the single occurrence of "time_t" in xapian.i to "long" makes it work on my system - but doesn't seem like a good idea portability-wise. -- Richard
On Wed, Nov 08, 2006 at 04:03:51PM +0000, Richard Boulton wrote:> I know that set_bias is a temporary API, but it would be good to be able to > use it as it is. Is there some trick that can let this work that I don't > know of, or is a fix needed to the bindings?It's not really much use as it is - I shouldn't have committed it in hindsight. Rather than fiddling with what's there now, I think time would be better spent finishing off the ExternalPostList patch: http://thread.gmane.org/gmane.comp.search.xapian.devel/741 We could then tweak that to provide weight information and use it to implement a general MatchBiasFunctor that was actually useful to people.> As far as I can tell, the problem is that SWIG doesn't know about the > time_t type, and there is no definition of it in the xapian.i file (or the > files this pulls in).I suspect this would fix it: %apply long time_t; But then you'll probably have to fix up the build system for C# at least, and it really isn't worth the effort. Cheers, Olly