lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <>
Subject Re: [jira] [Commented] (PYLUCENE-12) Add PythonReusableAnalyzerBase, so we can create analyzers in Python
Date Sat, 03 Dec 2011 22:10:56 GMT

On Fri, 2 Dec 2011, Michael McCandless (Commented) (JIRA) wrote:

> RE the exception inside createComponents... strange!  Your exception 
> indeed has all the details (ie, shows the original traceback, from the 
> createComponents method).
> Yet, when I do exactly that change (stick the x in, then run the test case 
> directly, I get this:

Did you build your lucene module with --shared (and did you build jcc with 
shared enabled, the default normally). It occurred to me that exception 
reporting is a bit weaker in non shared mode because the PythonException 
java class is not present. Just a thought...


> ======================================================================
> ERROR: testReusable (__main__.ReusableAnalyzerBaseTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "test/", line 36, in testReusable
>    stream = method("test", reader)
> JavaError: java.lang.RuntimeException: NameError
>    Java stacktrace:
> java.lang.RuntimeException: NameError
> 	at org.apache.pylucene.analysis.PythonReusableAnalyzerBase.createComponents(Native Method)
> 	at org.apache.lucene.analysis.ReusableAnalyzerBase.reusableTokenStream(
> Ie, for some reason, I don't get the traceback from the createComponents method; all
I see is that a NameError had happened, not what name in particular, and what lines of Python
> I'm on Linux, Python 64 bit, Java 1.6.0_21... I wonder if I somehow compiled things incorrectly?
>> Add PythonReusableAnalyzerBase, so we can create analyzers in Python
>> --------------------------------------------------------------------
>>                 Key: PYLUCENE-12
>>                 URL:
>>             Project: PyLucene
>>          Issue Type: Improvement
>>            Reporter: Michael McCandless
>>         Attachments: PYLUCENE-12.patch, PYLUCENE-12.patch
>> Lucene now has a useful helper class, ReusableAnalyzerBase; you subclass it and override
one method, to create an analyzer that provides reusableTokenStream impl.
>> I think we should expose it in Python... patch is simple.
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
> For more information on JIRA, see:

View raw message