Skip to content

Commit

Permalink
apps/contrib: update elasticsearch to 8
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk committed Oct 31, 2023
1 parent 9481871 commit 278e145
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions apps/contrib/elasticsearch.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down Expand Up @@ -51,7 +51,7 @@ def _get_results_from_hits(self, hits):
yield result


class ElasticsearchCustomSearchBackend(Elasticsearch7SearchBackend):
class ElasticsearchCustomSearchBackend(Elasticsearch8SearchBackend):
results_class = ElasticsearchResults


Expand Down
3 changes: 3 additions & 0 deletions changelog/_11112.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Changed

- update to elasticsearch 8
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 278e145

Please sign in to comment.