/wagtail-whoosh

Search backend for Wagtail CMS using Whoosh engine.

Primary LanguagePython

Search backend for Wagtail CMS using Whoosh engine.

Build Status

How to use

  • 0.1.x work with wagtail>=2.0,<2.2
  • 0.2.x work with wagtail>=2.2

pip install wagtail-whoosh

After installing this package, add wagtail_whoosh to INSTALLED_APPS. And then config WAGTAILSEARCH_BACKENDS

WAGTAILSEARCH_BACKENDS = {
    'default': {
        'BACKEND': 'wagtail_whoosh.backend',
        'PATH': str(ROOT_DIR('search_index'))
    },
}

Set ./manage.py update_index as cron job

Features

Score support

results = Page1.objects.search(query).annotate_score("_score").results()
result += Page2.objects.search(query).annotate_score("_score").results()
return sorted(results, key=lambda r: r._score)

NOT-Supported features

  1. boosting is not supported.
  2. facet is not supported.
  3. autocomplete is not supported.

Sponsor

Tomas Walch