On Jul 20, 2010, at 18:14, Bill Janssen <jans...@parc.com> wrote:

Andi Vajda <va...@apache.org> wrote:


On Jul 20, 2010, at 4:40, Bill Janssen <jans...@parc.com> 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)".

All true. The multiplication of branches, parallel releases of Lucene, PyLucene and JCC got a bit out of hand. At least now, the JCCs are the same.

Then, tongue in cheek, this being a volunteer effort of the community, had you participated in trying the release out before it got too late, this mishap could have been averted. Complaining after the fact is only half as good :-)

Of course, samples and tests using Hits broke after the fix. It didn't occur to me to make a bigger note of it. Sorry.

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"?

No, it's noted in the 2.5 -> 2.6 changes, last item.

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.

Of course you can. Some PyLucene unit tests might fail, though.

Porting your stuff to Lucene 3.0 is recommended...

Andi..


Bill

Reply via email to