[Xapian-discuss] bug in position_list_end?

James Aylett james-xapian at tartarus.org
Sat Jul 14 16:06:15 BST 2007


On Sat, Jul 14, 2007 at 04:56:51PM +0200, ...lorenzo wrote:

> it seems to me that method Database::position_list_end doesn't work!
> it returns a null pointer!
> any other way to know how long is a position list?

The end doesn't tell you how long the position list is, it tells you
whether you've got to the end. That's a pretty standard STL-ism.

You can do it another way. Get the Xapian::Document, grab the termlist
begin iterator, skip_to() the term you want, and call
positionlist_count().

If this sort of thing is likely to get used in lots of applications,
with no document context (I can't quickly think of how that might
happen, but I'm probably missing something), it could be added to
Xapian::Database. Possibly not worth the effort, however.

J

-- 
/--------------------------------------------------------------------------\
  James Aylett                                                  xapian.org
  james at tartarus.org                               uncertaintydivision.org



More information about the Xapian-discuss mailing list