[Xapian-discuss] Can xapian do geo search/calculations?
Richard Boulton
richard at lemurconsulting.com
Mon Aug 4 14:22:34 BST 2008
Francis Irving wrote:
> Out of interest, can you write new value range processor and/or match
> decider subclasses in a binding language?
>
> e.g. Phython or Ruby
Yes, you should be able to. Not all the wrapper languages currently
support language callbacks, but those two do. (The language needs to
have support in SWIG for "directors", but we do the appropriate things
in the xapian SWIG header files.)
The language specific documentation has some details about doing this.
ValueRangeProcessors and MatchDeciders can definitely be subclassed in
Python. MatchDeciders can definitely be subclassed in Ruby. The
documentation and tests for ruby don't mention ValueRangeProcessor, so
it's possible that doesn't currently work (it needed some special
handling to implement it in Python, because the C++ API involves a
string being passed by reference, or something like that, which Python
doesn't have an equivalent to).
There's a bit of an overhead to calling back to these languages (quite a
bit, actually), but in my experience it's not as bad as you might at
first expect calling back to Python for every document in the result set
to be.
--
Richard
More information about the Xapian-discuss
mailing list