diff --git a/apps/contrib/elasticsearch.py b/apps/contrib/elasticsearch.py index e490727c..133f998b 100644 --- a/apps/contrib/elasticsearch.py +++ b/apps/contrib/elasticsearch.py @@ -1,9 +1,9 @@ -from wagtail.search.backends.elasticsearch7 import Elasticsearch7SearchBackend -from wagtail.search.backends.elasticsearch7 import Elasticsearch7SearchResults +from wagtail.search.backends.elasticsearch8 import Elasticsearch8SearchBackend +from wagtail.search.backends.elasticsearch8 import Elasticsearch8SearchResults # Code below taken and modified from wagtails elasticsearch backend -class ElasticsearchResults(Elasticsearch7SearchResults): +class ElasticsearchResults(Elasticsearch8SearchResults): def _get_es_body(self, for_count=False): body = { 'query': self.query_compiler.get_query() @@ -51,7 +51,7 @@ def _get_results_from_hits(self, hits): yield result -class ElasticsearchCustomSearchBackend(Elasticsearch7SearchBackend): +class ElasticsearchCustomSearchBackend(Elasticsearch8SearchBackend): results_class = ElasticsearchResults diff --git a/changelog/_11112.md b/changelog/_11112.md new file mode 100644 index 00000000..55d2e01b --- /dev/null +++ b/changelog/_11112.md @@ -0,0 +1,3 @@ +### Changed + +- update to elasticsearch 8 diff --git a/requirements/base.txt b/requirements/base.txt index 16982d1f..bd14c27c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -7,6 +7,6 @@ django-widget-tweaks==1.4.12 sentry-sdk==1.32.0 wagtail==5.1.3 whitenoise==6.6.0 -elasticsearch==7.17.9 +elasticsearch==8.10.1 wagtail-metadata==4.0.3 sib-api-v3-sdk==7.6.0