I plan to implement a basic, tiny and reliable web search engine these days. It was difficult to write a search system all by myself, so I try to use PyLucene. After installing PyLucene on my Ubuntu, I find it a little bit user-unfriendly during the installation. However, this article will show how to install PyLucene.
About PyLucene
PyLucene is a Python extension for accessing Java Lucene. Its goal is to allow you to use Lucene’s text indexing and searching capabilities from Python. You can also visit here to get more info about PyLucene.
Requirement
- Python 2.x (x >= 3.5)
- Java 1.x (x >= 7)
Installation
- Download PyLucene Source from PyLucene
Unzip PyLucene
1
$ tar -zxvf pylucene-6.2.0-src.tar.gz
Install Ant, g++, python-dev
1
$ sudo apt-get install ant g++ python-dev
Build and install PyLucene/JCC
1
2
3
4cd to pylucene/jcc
modify setup.py (the only thing you need to do is change the name of JDK file)
$ sudo python setup.py build
$ sudo python setup.py installMake and install PyLucene
1
2
3
4
5cd to pylucene
modify Makefile (just uncomment lines for Ubuntu or your OS, don't forget to change the name of JDK file)
$ make
and it may take 10 minutes
$ sudo make installCong! Installation success! Try import lucene!