[Xapian-discuss] TermIterator question

Olly Betts olly at survex.com
Thu Nov 13 20:15:44 GMT 2008


Please send email to the list, not me directly.  That way other people can help
too, and the discussion is archived in a publicly searchable form.

2008/11/13 Zhiguo Li <zhiguo.li at gmail.com>:
> Actually when I tried the above command:
>
>   TermIterator t2 = query.get_terms_begin();
>   t2.skip_to(*t1);
>
>
> I got the following error:
> InvalidOperationError: VectorTermList::skip_to() not supported
>
> any suggestion?

Oh yes, the query terms are reported in the order they appeared in the query,
so skip_to()'s semantics don't make much sense for this case.

Simplest other approach is just to stick the terms in a vector of strings, and
then use that:

vector<string> query_terms(query.get_terms_begin(), query.get_terms_end());

Cheers,
    Olly



More information about the Xapian-discuss mailing list