[Xapian-devel] java-swig TermIterator

Eric Sellin eric at rxl1.com
Wed Sep 19 19:16:20 BST 2012


Hello,

Been using Xapian and the Java bindings for years, all was working
great, and I all of a sudden decided to upgrade to the latest 1.2.12 and
use the new java-swig bindings instead of the old hand-crafted JNI which
I think have been deprecated now.

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 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()?

Many thanks,
Eric.





More information about the Xapian-devel mailing list