You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Aaron Lav <as...@pobox.com> on 2009/03/09 22:49:21 UTC

bugs in PythonQueryParser and PythonMultiFieldQueryParser

It looks to me as if the shipped PythonQueryParser (for overriding
query parsing with Python code) only overrides the getBooleanQuery(Vector),
but that just calls getBooleanQuery(List,boolean), which is the function
which actually does the work (in the current version of Lucene).

I've attached a patch and a test case for PythonQueryParser.  It looks
like a very similar patch is needed for PythonMultiFieldQueryParser, but
the attached test case generates a java null pointer reference exception.
I thought I'd send it along anyway in case the bug is obvious.

   Aaron Lav (asl2@pobox.com)

Re: bugs in PythonQueryParser and PythonMultiFieldQueryParser

Posted by Andi Vajda <va...@apache.org>.
On Mon, 9 Mar 2009, Aaron Lav wrote:

> It looks to me as if the shipped PythonQueryParser (for overriding
> query parsing with Python code) only overrides the getBooleanQuery(Vector),
> but that just calls getBooleanQuery(List,boolean), which is the function
> which actually does the work (in the current version of Lucene).
>
> I've attached a patch and a test case for PythonQueryParser.  It looks
> like a very similar patch is needed for PythonMultiFieldQueryParser, but
> the attached test case generates a java null pointer reference exception.
> I thought I'd send it along anyway in case the bug is obvious.

MultiFieldQueryParser is a funny beast. You invoked it wrong. Instead of 
invoking QueryParser's parse() method you should call one of the 
MultiFieldQueryParser overloads that take more parameters. I fixed 
PythonMultiFieldQueryParser as per your patch and fixed the test case.

Thanks !

Andi..