Andi Vajda <[email protected]> wrote:

> 
> On Jul 20, 2010, at 4:40, Bill Janssen <[email protected]> wrote:
> 
> > Looks like the combination of JCC 2.6 and Lucene 2.9.3 have made some
> > significant API changes.  This is what I get with 2.9.3:
> >
> > % python /u/python/uplib/indexing.py search /local/demo-repo/index
> > picasso
> > [...]
> > hits are <Hits: org.apache.lucene.search.h...@f6f3dc> (0 hits)
> > Traceback (most recent call last):
> >  File "/u/python/uplib/indexing.py", line 930, in <module>
> >    search(sys.argv[2], sys.argv[3:])
> >  File "/u/python/uplib/indexing.py", line 897, in search
> >    print c.search(' '.join(searchterms))
> >  File "/u/python/uplib/indexing.py", line 687, in search
> >    for hit in hits:
> > lucene.JavaError: java.lang.IndexOutOfBoundsException: Not a valid
> > hit number: 0
> >    Java stacktrace:
> > java.lang.IndexOutOfBoundsException: Not a valid hit number: 0
> >    at org.apache.lucene.search.Hits.hitDoc(Hits.java:215)
> >    at org.apache.lucene.search.Hits.doc(Hits.java:168)
> >
> > In other words, Hits are now something I can take the length of, but
> > cannot enumerate?  Have we switched to TopDocs already?
> 
> There was a bug in jcc that assumed an Iterable out of Hits because of
> its iterator() method. But Hits doesn't actually implement Iterable
> (it's a Java 1.5 thing and Lucene 2.x is Java 1.4 compatible) it only
> mimicks it. You can call hits.iterator() for the same effect. See the
> tests and samples that use this class.

So a bug fix in jcc 2.6 breaks working PyLucene code?  I see what you're
saying, but it hardly seems like a good release policy for a micro
release bump, 2.9.2 to 2.9.3.  And it's probably worth mentioning in the
PyLucene 2.9.3 change log.  I can't be the only one using "search(query)".

Is this the change noted in the jcc 2.5.1 -> 2.5.2 CHANGES as
"fixed bug with not heeding type parameter for --sequence get method"?

Oh, well.  Do you suppose I can wrap Lucene 2.9.3 with jcc 2.5.1?  I'm
interested in the memory leak fixes in 2.9.3.

Bill

Reply via email to