Any python thread using PyLucene must be an instance of PyLuceneThread.
This is because the threading support in libgcj insists on
creating and initializing the thread for garbage collection.
After many months of trying I gave up on trying to tell libgcj about a thread
"after the facts". I could only get it to work on Mac OS X. Hands Boehm, the
author of the libgcj garbage collector, is aware of the issue and intends to
make this work in 'the future'.
I do not know how what it takes to make sure that the thread under which
you're running PyLucene code is running in a PyLuceneThread under mod_python.
If you manage to make it work (you're not the first one to try), please send
us detailed instructions how to.
Thanks !
Andi..
On Tue, 12 Jul 2005, Jonah Gold wrote:
Hi All -
I'm running Apache 2.0.54, mod_python 3.1.4, and Python 2.4.1 with
PyLucene 0.9.9. I'm trying to incorporate Porter stemming into a
search application I'm working on.
I'm defining my PorterStemmerAnalyzer class exactly as in the sample
included with PyLucene 0.9.9:
class PorterStemmerAnalyzer(object):
def tokenStream(self, fieldName, reader):
result = StandardTokenizer(reader)
result = StandardFilter(result)
result = LowerCaseFilter(result)
result = PorterStemFilter(result)
result = StopFilter(result, StopAnalyzer.ENGLISH_STOP_WORDS)
return result
I have a simple test of this stemmer outside of mod_python:
p = PorterStemmerAnalyzer()
foo = QueryParser.parse("mucking shoes shiny","text",PorterStemmerAnalyzer()
print foo.toString()
When I run this in python2.4, it gives me correct output without problems.
But when I run the equivalent test via mod_python:
def handler(req):
req.content_type = "text/plain"
p = PorterStemmerAnalyzer()
foo = QueryParser.parse("mucking shoes
shiny","text",PorterStemmerAnalyzer())
req.write(foo.toString())
return apache.OK
...the execution hangs, and my apache server will not return a result.
It isn't specific to the PorterStemFilter call in
PorterStemmerAnalyzer.tokenStream; it happens even if I comment that
out.
Any ideas for how to make this work? It would be a great feature if we
could get it going.
--
jonah
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev