From d05c0c1bc1ccfb0103dee973a30c646eeded6351 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Mon, 17 Jul 2023 10:47:39 +0100 Subject: [PATCH] Update docs to cover Elasticsearch 8 support --- docs/advanced_topics/add_to_django_project.md | 2 +- docs/contributing/developing.md | 7 +++---- docs/reference/settings.md | 2 +- docs/topics/search/backends.md | 13 +++++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/advanced_topics/add_to_django_project.md b/docs/advanced_topics/add_to_django_project.md index fc3eea86d6..4d316ee327 100644 --- a/docs/advanced_topics/add_to_django_project.md +++ b/docs/advanced_topics/add_to_django_project.md @@ -328,7 +328,7 @@ WAGTAIL_SITE_NAME = 'My Project' # Replace the search backend #WAGTAILSEARCH_BACKENDS = { # 'default': { -# 'BACKEND': 'wagtail.search.backends.elasticsearch5', +# 'BACKEND': 'wagtail.search.backends.elasticsearch8', # 'INDEX': 'myapp' # } #} diff --git a/docs/contributing/developing.md b/docs/contributing/developing.md index 2d94ab361b..cc9719bd81 100644 --- a/docs/contributing/developing.md +++ b/docs/contributing/developing.md @@ -159,11 +159,10 @@ It is also possible to set `DATABASE_DRIVER`, which corresponds to the `driver` ### Testing Elasticsearch -You can test Wagtail against Elasticsearch by passing the `--elasticsearch` -argument to `runtests.py`: +You can test Wagtail against Elasticsearch by passing the argument `--elasticsearch5`, `--elasticsearch6`, `--elasticsearch7` or `--elasticsearch8` (corresponding to the version of Elasticsearch you want to test against): ```sh -python runtests.py --elasticsearch +python runtests.py --elasticsearch8 ``` Wagtail will attempt to connect to a local instance of Elasticsearch @@ -173,7 +172,7 @@ If your Elasticsearch instance is located somewhere else, you can set the `ELASTICSEARCH_URL` environment variable to point to its location: ```sh -ELASTICSEARCH_URL=http://my-elasticsearch-instance:9200 python runtests.py --elasticsearch +ELASTICSEARCH_URL=https://my-elasticsearch-instance:9200 python runtests.py --elasticsearch8 ``` ### Unit tests for JavaScript diff --git a/docs/reference/settings.md b/docs/reference/settings.md index 2ae7f24c1c..3f0b25c1c9 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -52,7 +52,7 @@ If you use the ``False`` setting, keep in mind that serving your pages both with ```python WAGTAILSEARCH_BACKENDS = { 'default': { - 'BACKEND': 'wagtail.search.backends.elasticsearch5', + 'BACKEND': 'wagtail.search.backends.elasticsearch8', 'INDEX': 'myapp' } } diff --git a/docs/topics/search/backends.md b/docs/topics/search/backends.md index 5c4bb4d62d..dd8d66a6b6 100644 --- a/docs/topics/search/backends.md +++ b/docs/topics/search/backends.md @@ -62,11 +62,12 @@ This backend is intended to be used for development and also should be good enou ### Elasticsearch Backend -Elasticsearch versions 5, 6 and 7 are supported. Use the appropriate backend for your version: +Elasticsearch versions 5, 6, 7 and 8 are supported. Use the appropriate backend for your version: - `wagtail.search.backends.elasticsearch5` (Elasticsearch 5.x) - `wagtail.search.backends.elasticsearch6` (Elasticsearch 6.x) - `wagtail.search.backends.elasticsearch7` (Elasticsearch 7.x) +- `wagtail.search.backends.elasticsearch8` (Elasticsearch 8.x) Prerequisites are the [Elasticsearch](https://www.elastic.co/downloads/elasticsearch) service itself and, via pip, the [elasticsearch-py](https://elasticsearch-py.readthedocs.io/) package. The major version of the package must match the installed version of Elasticsearch: @@ -82,6 +83,10 @@ pip install "elasticsearch>=6.4.0,<7.0.0" # for Elasticsearch 6.x pip install "elasticsearch>=7.0.0,<8.0.0" # for Elasticsearch 7.x ``` +```sh +pip install "elasticsearch>=8.0.0,<9.0.0" # for Elasticsearch 8.x +``` + ```{warning} Version 6.3.1 of the Elasticsearch client library is incompatible with Wagtail. Use 6.4.0 or above. ``` @@ -91,8 +96,8 @@ The backend is configured in settings: ```python WAGTAILSEARCH_BACKENDS = { 'default': { - 'BACKEND': 'wagtail.search.backends.elasticsearch5', - 'URLS': ['http://localhost:9200'], + 'BACKEND': 'wagtail.search.backends.elasticsearch8', + 'URLS': ['https://localhost:9200'], 'INDEX': 'wagtail', 'TIMEOUT': 5, 'OPTIONS': {}, @@ -109,7 +114,7 @@ A username and password may be optionally supplied to the `URL` field to provide WAGTAILSEARCH_BACKENDS = { 'default': { ... - 'URLS': ['http://username:password@localhost:9200'], + 'URLS': ['https://username:password@localhost:9200'], ... } }