[Xapian-devel] java-swig TermIterator

Dan Colish dcolish at gmail.com
Thu Sep 20 03:51:24 BST 2012


Hey Eric,

That's correct. We'd like users to start moving to the swig bindings,
but honestly its not really ready.

> I'm struggling with the new design of the TermIterator. More
> specifically, I can't tell when I've reached the end of the list of
> terms for my document.
>
> If I keep calling next(), it will eventually crash in the C++ code and
> cause the JVM to crash as well, fair enough.
>
> If I call hasNext(), it always returns false, even though there are more
> terms that I can actually retrieve by calling next().
>
> If I try to compare my iterator to the termListEnd() of my document, it
> always returns false as well. I've tried comparison with both == and
> equals() just to be sure.

There are a number of bugs in the current release of these
bindings. This is just one of them. I have been working on a lot of
fixes which I will hopefully be able to land soon. In addition, I am
working on properly implementing the Iterator interface for this
iterator and the others.
>
> There must be something very simple I'm missing somewhere. Can somebody
> give me some sample code to iterate through a TermIterator returned by
> Document.termListBegin()?

Unfortunately, this will not work properly now. I'm curious, have you
noticed other issues with swig bindings? Bug reports will be greatly
appreciated!


-- 
Dan



More information about the Xapian-devel mailing list