A Django app to use RediSearch as a search backend in Wagtail.
- Django >= 3.2
- Wagtail >= 2.15
- RediSearch v2
Install wagtail-redisearch
from PyPi.
In your settings.py
add "wagtail_redisearch"
to INSTALLED_APPS
and configure your search backend as follows:
INSTALLED_APPS = [
"wagtail_redisearch",
...
]
WAGTAILSEARCH_BACKENDS = {
"default": {
"BACKEND": "wagtail_redisearch",
# optional parameters
"INDEX": "custom-index-name", # default: "wagtail"
"HOST": "127.0.0.1",
"PORT": 6379,
# you can add any option here to be used when initializing
# a Redis client with redis-py.
# e.g.
"retry_on_error": True
}
}
For more information about what options you can pass to the Redis client, look at the official documentation.
wagtail-redisearch
implements the interfaces described in Backends Rolling your own, thus usage in Wagtail requires no special adjustment.
To configure search on your models, follow the official Wagtail documentation.
To contribute to this project you'll need RediSearch installed and poetry
.
# install dependencies
poetry install
# run tests
make test
# run tests with tox
make test-all
# to run a minimal Wagtail application to test things out
make run