/simple_search

A simple search API

Primary LanguagePythonMIT LicenseMIT

This is a really basic search engine for Django. To use, simply add simple_search to INSTALLED_APPS
and register models for searching as follows:


class MyModel(Model):
    field1 = models.CharField(max_length=1000)

    class Search:
         fields = [
             "field1"
         ]


Then import simple_search.models.Index and call search:

from simple_search.models import Index
Index.search(MyModel, 'this is a "search string"')

search() can take pagination options. There is still plenty unimplemented (see the comment in models.py)

The ranking algorithm prioritises multiple word matches and uncommon matches.