Skip to content

Commit

Permalink
Release 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeray Diaz Diaz committed Mar 21, 2018
1 parent 2711ce6 commit 868c449
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Build Status](https://travis-ci.org/yeraydiazdiaz/lunr.py.svg?branch=master)](https://travis-ci.org/yeraydiazdiaz/lunr.py)
[![codecov](https://codecov.io/gh/yeraydiazdiaz/lunr.py/branch/master/graph/badge.svg)](https://codecov.io/gh/yeraydiazdiaz/lunr.py)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/lunr.svg)](https://pypi.org/project/lunr/)
[![PyPI](https://img.shields.io/pypi/v/lunr.svg)](https://pypi.org/project/lunr/)

# Lunr.py

Expand All @@ -11,12 +13,18 @@ This Python version of Lunr.js aims to bring the simple and powerful full text s

## Current state:

Lunr.py produces the same results as Lunr.js both in Python 2.7 and 3 for [non-trivial corpus of documents](https://github.com/yeraydiazdiaz/lunr.py/blob/master/tests/acceptance_tests/fixtures/search_index.json).
Each version of lunr.py [targets a specific version of lunr.js](https://github.com/yeraydiazdiaz/lunr.py/blob/master/lunr/__init__.py#L12) and produces the same results as it both in Python 2.7 and 3 for [non-trivial corpus of documents](https://github.com/yeraydiazdiaz/lunr.py/blob/master/tests/acceptance_tests/fixtures/search_index.json).

Lunr.py also serializes `Index` instances respecting the [`lunr-schema`](https://github.com/olivernn/lunr-schema) which are consumable by Lunr.js and viceversa.

The API is in alpha stage and likely to change.

## Usage:

You'll need a list of dicts representing the documents you want to search on. These documents must have a unique field which will serve as a reference and a series of fields you'd like to search on.

Lunr provides a convenience `lunr` function to quickly index this set of documents:

```python
>>> from lunr import lunr
>>>
Expand All @@ -36,4 +44,4 @@ The API is in alpha stage and likely to change.
[{'ref': 'a', 'score': 0.6931722372559913, 'match_data': <MatchData "kill">}]
>>> idx.search('study')
[{'ref': 'b', 'score': 0.23576799568081389, 'match_data': <MatchData "studi">}, {'ref': 'a', 'score': 0.2236629211724517, 'match_data': <MatchData "studi">}]
```
```
2 changes: 1 addition & 1 deletion lunr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

logging.basicConfig(format="%(levelname)-7s - %(message)s")

__VERSION__ = '0.1.1a1'
__VERSION__ = '0.1.2'
__TARGET_JS_VERSION__ = '2.1.5'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
LONG_DESCRIPTION = (
"A Python implementation of Lunr.js (https://lunrjs.com) by Oliver "
"Nightingale.\n\n"
"> A bit like Solr, but much smaller and not as bright.\n\n"
" A bit like Solr, but much smaller and not as bright.\n\n"
"This Python version of Lunr.js aims to bring the simple and powerful "
"full text search capabilities into Python guaranteeing results as close "
"as the original implementation as possible."
Expand Down

0 comments on commit 868c449

Please sign in to comment.