Andi Vajda wrote:
>
> 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.
We have PyLucene working under mod_python in both Linux and Windows,
threaded and non-threaded Apache, in a way. We found any problem with
Apache prefork (crashes, hangs) were usually due to us using PyLucene
incorrectly (keeping IndexReaders open while trying to delete the entire
index, etc.), although some of the problems were a nightmare to debug.
We have dealt with threaded Apache installations by running all PyLucene
code in a different process from Apache - the module we use to control
PyLucene for our program auto-detects being under threaded Apache and
launches the process, communicating with it via HTTP after that. As
long as all indexing happens in a different, fully Python process, it
runs without a problem.
This is more of an "avoid the problem" than an actual solution, but I
thought the list might want to know that someone has made PyLucene under
mod_python workable.
HTH,
David Moore
>
> 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
>
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.8.13/47 - Release Date: 2005/07/12
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev