[Xapian-discuss] having trouble getting position lists from
termtierators
Olly Betts
olly at survex.com
Wed Nov 1 02:18:26 GMT 2006
On Tue, Oct 31, 2006 at 12:37:12PM -0500, Jarrod Roberson wrote:
> here is the code I can't get to work, every term throws a
> Xapian::InvalidOperationError
> begin and end are pointers to copies of the begin and end iterators from
> database.
What do you mean by "from database"?
If you're trying to iterate positions from a TermIterator returned by
allterms_begin(), then this is the expected behaviour - there's no
implicit document id context to use to get the positions (a
PositionIterator lists the occurences of a particular term in a
particular document, so a document id and a termname are required).
Note that you can use the termname from the TermIterator and a document
id and use Database::positionlist_begin(did, termname) to create the
PositionIterator.
If this isn't the problem, a compilable example would probably be useful
(ideally without the cocoa parts as the only OS X machines I have access
to are at sourceforge and seem to be offline most of the time).
Cheers,
Olly
More information about the Xapian-discuss
mailing list