[Xapian-discuss] Are you supposed to be able to get Position information from TermIterators returned from the Database.allterms iterators?

richard at lemurconsulting.com richard at lemurconsulting.com
Tue Oct 31 20:38:56 GMT 2006


On Tue, Oct 31, 2006 at 02:36:08PM -0500, Jarrod Roberson wrote:
> I am trying to get position information from TermIterators returned from
> Database.allterms_begin() and it does nothing but throw
> Xapian::InvalidOperationError()
> when I try and call .positionlist_begin() on the TermIterator.

This is the expected behaviour, currently.  What list of positions would
you expect?  A position list is defined for a particular combination of
term and document: when iterating through the "allterm" list, you only have
a term, but no document.

What you should be able to do is open a posting list for each term returned
by your allterm list, and then get a position list for each document
returned by that posting list.  I'm not sure what you're trying to achieve,
but this may be helpful.

-- 
Richard



More information about the Xapian-discuss mailing list