Skip to content

Lightweight in-process search engine for Python

License

Notifications You must be signed in to change notification settings

openculinary/hashedixsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Lightweight in-process search engine for Python

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages