Update docs to cover Elasticsearch 8 support

pull/10477/head
Matt Westcott 2023-07-17 10:47:39 +01:00
rodzic 54f4f510b1
commit d05c0c1bc1
4 zmienionych plików z 14 dodań i 10 usunięć

Wyświetl plik

@ -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'
# }
#}

Wyświetl plik

@ -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

Wyświetl plik

@ -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'
}
}

Wyświetl plik

@ -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'],
...
}
}