diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b93cadd77..b364170ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: matrix: django-version: [2.2, 3.1, 3.2] python-version: [3.6, 3.7, 3.8, 3.9] - elastic-version: [1.7, 2.4, 5.5] + elastic-version: [1.7, 2.4, 5.5, '7.13.1'] include: - django-version: 2.2 python-version: 3.5 @@ -21,6 +21,9 @@ jobs: - django-version: 2.2 python-version: 3.5 elastic-version: 5.5 + - django-version: 2.2 + python-version: 3.5 + elastic-version: '7.13.1' services: elastic: image: elasticsearch:${{ matrix.elastic-version }} diff --git a/haystack/backends/elasticsearch7_backend.py b/haystack/backends/elasticsearch7_backend.py index a8d2db572..723424eaf 100644 --- a/haystack/backends/elasticsearch7_backend.py +++ b/haystack/backends/elasticsearch7_backend.py @@ -16,13 +16,13 @@ try: import elasticsearch - if not ((5, 0, 0) <= elasticsearch.__version__ < (6, 0, 0)): + if not ((7, 0, 0) <= elasticsearch.__version__ < (8, 0, 0)): raise ImportError from elasticsearch.helpers import bulk, scan except ImportError: raise MissingDependency( "The 'elasticsearch5' backend requires the \ - installation of 'elasticsearch>=5.0.0,<6.0.0'. \ + installation of 'elasticsearch>=7.0.0,<8.0.0'. \ Please refer to the documentation." ) diff --git a/test_haystack/elasticsearch7_tests/__init__.py b/test_haystack/elasticsearch7_tests/__init__.py index 09f1ab176..6491d464a 100644 --- a/test_haystack/elasticsearch7_tests/__init__.py +++ b/test_haystack/elasticsearch7_tests/__init__.py @@ -13,14 +13,14 @@ def setup(): try: import elasticsearch - if not ((5, 0, 0) <= elasticsearch.__version__ < (6, 0, 0)): + if not ((7, 0, 0) <= elasticsearch.__version__ < (8, 0, 0)): raise ImportError from elasticsearch import Elasticsearch, exceptions except ImportError: log.error( - "Skipping ElasticSearch 5 tests: 'elasticsearch>=5.0.0,<6.0.0' not installed." + "Skipping ElasticSearch 7 tests: 'elasticsearch>=7.0.0,<8.0.0' not installed." ) - raise unittest.SkipTest("'elasticsearch>=5.0.0,<6.0.0' not installed.") + raise unittest.SkipTest("'elasticsearch>=7.0.0,<8.0.0' not installed.") url = settings.HAYSTACK_CONNECTIONS["elasticsearch"]["URL"] es = Elasticsearch(url) diff --git a/tox.ini b/tox.ini index 6548f1023..9eefabfc8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = docs - py35-django2.2-es{1.x,2.x,5.x} - py{36,37,38,py}-django{2.2,3.0}-es{1.x,2.x,5.x} + py35-django2.2-es{1.x,2.x,5.x,7.x} + py{36,37,38,py}-django{2.2,3.0}-es{1.x,2.x,5.x,7.x} [testenv] @@ -16,10 +16,12 @@ deps = es1.x: elasticsearch>=1,<2 es2.x: elasticsearch>=2,<3 es5.x: elasticsearch>=5,<6 + es7.x: elasticsearch>=7,<8 setenv = es1.x: VERSION_ES=>=1,<2 es2.x: VERSION_ES=>=2,<3 es5.x: VERSION_ES=>=5,<6 + es7.x: VERSION_ES=>=7,<8 [testenv:docs]