3523
Kommentar: finished
|
3478
layout
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 1: | Zeile 1: |
||<tablestyle="float: right;"> '''Inhalt'''[[TableOfContents]] || | [[TableOfContents]] |
Zeile 11: | Zeile 12: |
---- | |
Zeile 14: | Zeile 15: |
== Which version of Lucene? == | == Which version of !PyLucene? == |
What is it about?
[http://pylucene.osafoundation.org/ PyLucene] is a [http://python.org/ python] interface for the [http://lucene.apache.org/ Lucene] indexing engine.
Indexing engines are used to parse data and store the content in way that is optimized for searching through it.
Another popular indexing engine is [http://xapian.org Xapian], but since its installation in Debian is more than trivial, there is no need for a howto :).
The installation of PyLucene is worth a howto, since the settings of the installer are statically put together without any auto-configuration.
Preparation
Which version of !PyLucene?
Currently there are two different releases of PyLucene available:
to be built with [http://gcc.gnu.org/java/ GCJ] (the Java compiler from [http://gnu.org GNU]): for PyLucene v2.2 and below
to be built with [http://svn.osafoundation.org/pylucene/trunk/jcc/jcc/README JCC] (an alternative implementation): for PyLucene v2.2 and higher
The developer of PyLucene dropped support for GCJ since version 2.3, thus it should be reasonable to use the JCC sources.
Installation
Get the source
download the source from the PyLucene download site: http://downloads.osafoundation.org/PyLucene/jcc/
unpack it in a directory of your choice (tar xzf ...)
- change into the source directory
Compile JCC
You may skip this step, if you already have a working JCC installation.
install required packages:
aptitude install sun-java5-jdk g++ python-dev
work around the wrong pre-settings in jcc/setup.py - a little bit dirty, but it works (alternative: fix the INCLUDE, CFLAGS and LFLAGS for linux in jcc/setup.py):
ln -s java-1.5.0-sun /usr/lib/jvm/java-6-sun
compile JCC:
cd jcc python setup.py build
install JCC (as root user):
python setup.py install
fix the installation location with a symlink:
ln -s JCC-1.8-py2.4-linux-i686.egg/jcc /usr/lib/python2.4/site-packages/
check if the symlink works (otherwise you may have to adjust the path above):
test -e /usr/lib/python2.4/site-packages/jcc && echo "OK" || echo "Failed"
test if the jcc python module can be imported (no output -> OK):
python -c "import jcc"
Compile PyLucene
Please notice: the installer's Makefile does not like to restart after errors. Use make realclean (instead of the usual distclean) before trying to restart/continue compilation! Beware: this requires a working internet connection for a repository download.
install required packages:
aptitude install ant make subversion
uncomment the appropriate bunch of settings in Makefile - the one for Linux (Ubuntu 6.06, Python 2.4, Java 1.5):
PREFIX_PYTHON=/usr ANT=ant PYTHON=$(PREFIX_PYTHON)/bin/python JCC=$(PYTHON) $(PREFIX_PYTHON)/lib/python2.4/site-packages/jcc/__init__.py NUM_FILES=1
compile:
make
install:
make install
Troubleshooting
undefined symbol during PyLucene build
This can be caused by having some part of gcj installed while compiling jcc.
Check if gcj is installed by issuing the following line (no output -> OK):
dpkg -l | grep gcj | grep ^i
In case it was installed:
remove gcj
recompile jcc
reinstall jcc
recompile PyLucene