On Mon, 8 Sep 2008, Martin Bachwerk wrote:

Ahh! Great, thanks!

This is like sooooo much quicker than iterating over termDocs with next().. and personally I wouldn't care about how it looks, if only one knew where to look up this information ;)

The samples are a great place to look for answers. Then, there's always the source :)

Andi..


Thanks again!
Martin

On Mon, 8 Sep 2008, Martin Bachwerk wrote:

I've been trying to use the read() method on TermDocs as described for
PyLucene (with an int to specify the number of documents to read in).
However, I've been getting an error, that sort of suggests, that the
call is actually trying to run the Java API version of the method (with
2 arrays as arguments and an integer n as return value).. This actually
works too, but only asfar as the integer, I can't find a way to fill the
two arrays.. :(

Error trace:
docs, freqs = td.read(10)
InvalidArgsError: (<type 'TermDocs'>, 'read', (10,))

Could someone please help! I'm using PyLucene 2.3.1.

The docs are out of data here, sorry.

In the new PyLucene (the one built with JCC, the one you're running), the docs should say that a PythonTermDocs instance should be wrapped around the TermDocs instance as follows: (also see SpecialsFilter.py sample)

  values = PythonTermDocs(td).read(10)
  docs=values[:len(values)/2]
  freqs=values[len(values/2):]

Yes, this is quite ugly and I intend to change the way arrays are handled in JCC before I release version 2.0 so that this kind of kludge is no longer necessary.

Andi..


Thanks,

Martin



_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev




_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to