[pylucene-dev] newcomer's questions

Andi Vajda vajda at osafoundation.org
Mon Dec 10 10:27:03 PST 2007


On Mon, 10 Dec 2007, Helmut Jarausch wrote:

> I'm seeing to different implementations - jcc and gcj based.
> Both seem actively developped and quite recent (they fetch a SVN 2.2.0
> version of Lucene)

The gcj-based one is more or less getting deprecated as the open source java 
energies are moving over to openjdk. I don't intend to do much work on the 
gcj side of PyLucene anymore.

> What's the difference from an application (Python-) programmer's
> view? Differences in the API, speed ?

The PyLucene API is very close to the Java Lucene API. Especially in the jcc 
side of PyLucene as it's completely machine-generated. Of course, PyLucene 
attempts to offer pythonic APIs in addition to the java-like verbose ones 
such as iterators, for example.

The differences between the PyLucene API and the Java Lucene API are 
documented in PyLucene's README files. The differences between gcj PyLucene 
and jcc PyLucene are documented in [1]

> Furthermore, how can I subclass a (Java-) class in Lucene.
> E.g. in the LIA book  SimpleKeywordAnalyzer is subclassed ('extends' in
> Java) from Analyzer. The PyLucene version does not subclass anything
> (except object). Is it possible to subclass e.g. a builtin analyzer
> class like SimpleAnalyzer?

In gcj-PyLucene, a number of classes are setup for extension but adding your 
own is tricky. In jcc-PyLucene, it's much easier to write your own 
extensions, in Python, of Java Lucene classes.
All the "Lucene in Action" samples were ported to Python for _both_ gcj [2] 
and jcc [3] PyLucene. It's easiest to take a look at how it's done there as 
they have many extension examples.

In addition, there is documentation about this topic in jcc's README file 
[4]. jcc knows nothing about Lucene proper, so even though it is part of the 
PyLucene project at the moment, it can be released separately (as it is on 
cheeseshop already [5]) and has its own documentation [4].

Andi..

[1] http://svn.osafoundation.org/pylucene/trunk/README
[2] http://svn.osafoundation.org/pylucene/trunk/gcj/samples/LuceneInAction
[3] http://svn.osafoundation.org/pylucene/trunk/jcc/samples/LuceneInAction
[4] http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README
[5] http://pypi.python.org/pypi/JCC/1.5


More information about the pylucene-dev mailing list