[Xapian-discuss] phrase/near match positions

Olly Betts olly at survex.com
Sat Nov 11 11:18:13 GMT 2006


On Sat, Nov 11, 2006 at 11:29:55AM +0100, Jean-Francois Dockes wrote:
> I am looking for a way to determine at which term position in a document a
> NEAR or PHRASE match occurrs (for abstract/sample/highlighting purposes).
> 
> Would there be something I'm not seeing in the API that would
> help/do this for me?

I'm afraid not.  We don't keep that information around during the match
(we could consider keeping the position of the matching position we
find, but I suspect most people would want to know about more matches).

There's currently no public to the code which does this.

> If not, would it be suitable to duplicate/adapt the code from
> phrasepostlist.cc to redo the matching, or would someone see a better way ?

Perhaps we should have a public API to that code.  Or have some sort of
"generate a sample of about length N from text T using query Q" API.
It would be nice if you could store a lot of document text and have
Omega produce a context sensitive sample.

Cheers,
    Olly



More information about the Xapian-discuss mailing list