Can I use lucene directly from python, preferably without using a binary module?
I am interested mainly in read access -- being able to perform queries from python over existing lucene indexes.
Lucene is a full-text search library in Java which makes it easy to add search functionality to an application or website. It does so by adding content to a full-text index.
First written in 1999 by Doug Cutting, still going strong... Apache Lucene, the full-text search library, has operated and been maintained for more than 20 years and for many developers is an integral part of their website and application builds.
Why is Lucene faster? Lucene is very fast at searching for data because of its inverted index technique. Normally, datasources structure the data as an object or record, which in turn have fields and values.
Lucene or Apache Lucene is an open-source Java library used as a search engine. Elasticsearch is built on top of Lucene. Elasticsearch converts Lucene into a distributed system/search engine for scaling horizontally.
PyLucene is a Python wrapper around Lucene. Therefore, you have to install Lucene as well, and its installation may be a bit complex (especially on Windows!)
You can't use Lucene itself from CPython without using a binary module, no.
You could use it directly from Jython, or you could use a Python port of Lucene, eg. Lupy (though Lupy is no longer under development).
If you're prepared to relax your non-binary requirement, PyLucene is a wrapper that embeds Java Lucene into Python.
This similar question offers some options: Is there a pure Python Lucene?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With