[pylucene-dev] HitCollector in PyLucene extremely slow

Andi Vajda vajda at osafoundation.org
Thu Sep 6 23:00:46 PDT 2007


On Thu, 6 Sep 2007, John Kleven wrote:

> static void
> *j_indexsearcher_setDocSizes(j_indexsearcher *self,
> PyObject *arg)
> {
>    jintArray docSizes;
>
>    if (!parseArg(arg, "K", &JArray<jint>::class$,
> &docSizes))
>    {
>      OBJ_CALL(self->object->setDocSizes(docSizes));
>      Py_RETURN_NONE;
>    }
>
>    return PyErr_SetArgsError((PyObject *) self,
> "setDocSizes", arg);
> }
>
> In particular, this line is killing me:
> if (!parseArg(arg, "K", &JArray<jint>::class$,
> &docSizes))

"K" is meant to be used with a Java object array not a Java primitive array.
There is no support in parseArgs() - which is defined in functions.cpp - for 
passing in an array of int. You may of course assign a new letter of your 
choice for that purpose in parseArgs() and implement the unpacking of a python 
sequence of ints into a jintArray (a JArray<jint>).

Andi..



More information about the pylucene-dev mailing list