hashedixsearch

in-process search-engine for python


Keywords
highlighting, search
License
Other
Install
pip install hashedixsearch==1.2.4

Documentation

hashedixsearch

hashedixsearch is a lightweight in-process search engine for Python, with support for stemming, custom token analyzers, and query match highlighting.

Usage

from hashedixsearch import HashedIXSearch

doc = 'find the needle in the haystack'

index = HashedIXSearch()
index.add(doc_id=1, doc=doc)

results = index.query_batch(['find'])
for query, hits in results:
    for hit in hits:
        # <mark>find</mark> the needle in the haystack
        markup = index.highlight(doc=doc, terms=hit['terms'])

This library uses hashedindex for tokenization and indexing.