[Xapian-discuss] identifying matched terms
Jason Toffaletti
jason at subterrific.net
Wed Dec 21 00:28:45 GMT 2005
I finally got around to implementing this and I ran into another issue.
I'm using the xapian python bindings and whenever I call
positionlist_begin on a TermIterator, I get this:
File "/usr/lib/python2.4/site-packages/xapian.py", line 169, in
positionlist_begin
def positionlist_begin(*args): return
_xapian.TermIterator_positionlist_begin(*args)
RuntimeError: InvalidOperationError: positionlist_begin not supported
Which is consistent with the code I see here:
http://www.xapian.org/docs/sourcedoc/html/termlist_8h-source.html
I don't think I can implement what I want without the positionlist. My
document is composed of terms that come from several sources and I need
to know the position of the term to figure out which source a term came
from and then relay that information to the front-end which would
highlight the term in its unmodified form.
Is positionlist something planned for the next revision?
Thanks,
Jason T.
On Fri, 2005-12-02 at 00:51 +0000, Olly Betts wrote:
> On Thu, Dec 01, 2005 at 04:27:32PM -0800, Jason Toffaletti wrote:
> > I'm having trouble finding information on how to identify which terms
> > within a document triggered a match for a query. I'd like to use this
> > information to highlight the terms when displaying query results to a
> > user, much like how gmane or google do. Is there an API for this
> > purpose?
>
> Yes:
>
> http://xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html#a18
>
> Hmm, it seems you should really be able to call methods on an
> MSetIterator to get this information - the Enquire class isn't the most
> logical place for them. I'll have a look and see if there's a good
> reason why this is part of Enquire.
>
> Cheers,
> Olly
>
More information about the Xapian-discuss
mailing list