A MeiliSearch backend for Wagatil
Project description
Wagtail MeiliSearch
This is a (beta) Wagtail search backend for the MeiliSearch search engine.
Installation
poetry add wagtail_meilisearch
or pip install wagtail_meilisearch
Configuration
See the MeiliSearch docs for info on the values you want to add here.
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail_meilisearch.backend',
'HOST': os.environ.get('MEILISEARCH_HOST', 'http://127.0.0.1'),
'PORT': os.environ.get('MEILISEARCH_PORT', '7700'),
'MASTER_KEY': os.environ.get('MEILI_MASTER_KEY', '')
},
}
Stop Words
Stop words are words for which we don't want to place significance on their frequency. For instance, the search query tom and jerry
would return far less relevant results if the word and
was given the same importance as tom
and jerry
. There's a fairly sane list of English language stop words supplied, but you can also supply your own. This is particularly useful if you have a lot of content in any other language.
MY_STOP_WORDS = ['a', 'list', 'of', 'words']
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail_meilisearch.backend',
[...]
'STOP_WORDS': MY_STOP_WORDS
},
}
Or alternatively, you can extend the built in list.
from wagtail_meilisearch.settings import STOP_WORDS
MY_STOP_WORDS = STOP_WORDS + WELSH_STOP_WORDS + FRENCH_STOP_WORDS
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail_meilisearch.backend',
[...]
'STOP_WORDS': MY_STOP_WORDS
},
}
Contributing
If you want to help with the development I'd be more than happy. The vast majority of the heavy lifting is done by MeiliSearch itself, but there is a TODO list...
TODO
- Faceting
- Implement boosting in the sort algorithm
- Write tests
- Performance improvements - particularly in the autocomplete query compiler which for some reason seems slower than the regular one.
Implement stop wordsSearch resultsAdd support for the autocomplete apiEnsure we're getting results by relevance
Thanks
Thank you to the devs of Wagtail-Whoosh. Reading the code over there was the only way I could work out how Wagtail Search backends are supposed to work.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for wagtail-meilisearch-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1649cc430f1b431b59f08145632ca7f73bd81922515e9a2867c2b316db4620 |
|
MD5 | 35613d642bf3835df087c0cb6a026f3d |
|
BLAKE2b-256 | ee58b9265604b9b60f9d3de03441d411ea1f94b0c7d02e8fd13005d2e4595e93 |
Hashes for wagtail_meilisearch-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68d8c76cb4c1634317eeae5b10c71a63b87c465f32bc18b3d780f123a1c0c3b0 |
|
MD5 | afe81ddaaf53ab31279513275b6f8132 |
|
BLAKE2b-256 | 7acc69b970a55ba2e36ed263f03d72c1c1d4590c104f632128eb921bfc9711ff |