Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Pythonic search engine based on PyLucene, including a standalone server based on CherryPy.

Project Description

Lupyne is a search engine based on PyLucene, the Python extension for accessing Java Lucene. Lucene is a relatively low-level toolkit, and PyLucene wraps it through automatic code generation. So although Java idioms are translated to Python idioms where possible, the resulting interface is far from Pythonic. See ./examples for comparisons with the Lucene API.

Lupyne also provides a RESTful JSON search server, based on CherryPy. Note Solr and Elasticsearch are popular options for Lucene-based search, if no further (Python) customization is needed. So while the server is suitable for production usage, its primary motivation is to be an extensible example.

Not having to initially choose between an embedded library and a server not only provides greater flexibility, it can provide better performance, e.g., batch indexing offline and remote searching live. Additionally only lightweight wrappers with extended behavior are used wherever possible, so falling back to using PyLucene directly is always an option, but should never necessary for performance.

Usage

PyLucene requires initializing the VM.

import lucene

lucene.initVM()

Indexes are accessed through an IndexSearcher (read-only), IndexWriter, or the combined Indexer.

from lupyne import engine

searcher = engine.IndexSearcher('index/path')
hits = searcher.search('text:query')

Run the server.

$ python -m lupyne.server

Read the documentation.

Installation

$ pip install lupyne

Dependencies

  • PyLucene >=6.5 (installed separately)
  • six

Optional server extras

  • Python >=3.4
  • CherryPy >=10
  • clients >=0.2

Tests

100% branch coverage.

$ pytest [--cov]

Changes

2.0

  • PyLucene >=6 required
  • Python 3 support
  • client moved to external package

1.9

  • Python 2.6 dropped
  • PyLucene 4.8 and 4.9 dropped
  • IndexWriter implements context manager
  • Server DocValues updated via patch method
  • Spatial tile search optimized

1.8

  • PyLucene 4.10 supported
  • PyLucene 4.6 and 4.7 dropped
  • Comparator iteration optimized
  • Support for string based FieldCacheRangeFilters

Release History

This version
History Node

2.0

History Node

1.9

History Node

1.8

History Node

1.7

History Node

1.6

History Node

1.5

History Node

1.4

History Node

1.3

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
lupyne-2.0-py2.py3-none-any.whl
(34.2 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Dec 29, 2017
lupyne-2.0.tar.gz
(755.6 kB) Copy SHA256 Hash SHA256
Source None Dec 29, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting