Skip to content

Commit

Permalink
Remove elasticsearch 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Nov 5, 2020
1 parent 4d6a41a commit 6e1e362
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 896 deletions.
2 changes: 1 addition & 1 deletion docs/advanced_topics/add_to_django_project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ These two files should reside in your project directory (``myproject/myproject/`
# Replace the search backend
#WAGTAILSEARCH_BACKENDS = {
# 'default': {
# 'BACKEND': 'wagtail.search.backends.elasticsearch2',
# 'BACKEND': 'wagtail.search.backends.elasticsearch5',
# 'INDEX': 'myapp'
# }
#}
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Search
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.elasticsearch2',
'BACKEND': 'wagtail.search.backends.elasticsearch5',
'INDEX': 'myapp'
}
}
Expand Down
12 changes: 3 additions & 9 deletions docs/topics/search/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ See :ref:`postgres_search` for more detail.
Elasticsearch Backend
---------------------

Elasticsearch versions 2, 5, 6 and 7 are supported. Use the appropriate backend for your version:

``wagtail.search.backends.elasticsearch2`` (Elasticsearch 2.x)
Elasticsearch versions 5, 6 and 7 are supported. Use the appropriate backend for your version:

``wagtail.search.backends.elasticsearch5`` (Elasticsearch 5.x)

Expand All @@ -105,10 +103,6 @@ Prerequisites are the `Elasticsearch`_ service itself and, via pip, the `elastic

.. _Elasticsearch: https://www.elastic.co/downloads/elasticsearch

.. code-block:: console
$ pip install "elasticsearch>=2.0.0,<3.0.0" # for Elasticsearch 2.x
.. code-block:: sh
pip install "elasticsearch>=5.0.0,<6.0.0" # for Elasticsearch 5.x
Expand All @@ -132,7 +126,7 @@ The backend is configured in settings:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.elasticsearch2',
'BACKEND': 'wagtail.search.backends.elasticsearch5',
'URLS': ['http://localhost:9200'],
'INDEX': 'wagtail',
'TIMEOUT': 5,
Expand Down Expand Up @@ -200,7 +194,7 @@ The Elasticsearch backend is compatible with `Amazon Elasticsearch Service`_, bu
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.elasticsearch2',
'BACKEND': 'wagtail.search.backends.elasticsearch5',
'INDEX': 'wagtail',
'TIMEOUT': 5,
'HOSTS': [{
Expand Down
6 changes: 1 addition & 5 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def make_parser():
parser = argparse.ArgumentParser()
parser.add_argument('--deprecation', choices=['all', 'pending', 'imminent', 'none'], default='imminent')
parser.add_argument('--postgres', action='store_true')
parser.add_argument('--elasticsearch2', action='store_true')
parser.add_argument('--elasticsearch5', action='store_true')
parser.add_argument('--elasticsearch6', action='store_true')
parser.add_argument('--elasticsearch7', action='store_true')
Expand Down Expand Up @@ -52,10 +51,7 @@ def runtests():
if args.postgres:
os.environ['DATABASE_ENGINE'] = 'django.db.backends.postgresql'

if args.elasticsearch2:
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
os.environ.setdefault('ELASTICSEARCH_VERSION', '2')
elif args.elasticsearch5:
if args.elasticsearch5:
os.environ.setdefault('ELASTICSEARCH_URL', 'http://localhost:9200')
os.environ.setdefault('ELASTICSEARCH_VERSION', '5')
elif args.elasticsearch6:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# Required for running the tests
'python-dateutil>=2.2',
'pytz>=2014.7',
'elasticsearch>=1.0.0,<3.0',
'elasticsearch>=5.0,<6.0',
'Jinja2>=2.8,<3.0',
'boto3>=1.16,<1.17',
'freezegun>=0.3.8',
Expand Down
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
skipsdist = True
usedevelop = True

envlist = py{36,37,38,39}-dj{22,30,31,31stable,master}-{sqlite,postgres,mysql,mssql}-{elasticsearch7,elasticsearch6,elasticsearch5,elasticsearch2,noelasticsearch}-{customuser,emailuser}-{tz,notz},
envlist = py{36,37,38,39}-dj{22,30,31,31stable,master}-{sqlite,postgres,mysql,mssql}-{elasticsearch7,elasticsearch6,elasticsearch5,noelasticsearch}-{customuser,emailuser}-{tz,notz},

[testenv]
install_command = pip install -e ".[testing]" -U {opts} {packages}
commands =
elasticsearch2: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch2
elasticsearch5: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch5
elasticsearch6: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch6
elasticsearch7: coverage run runtests.py wagtail.search wagtail.documents wagtail.images --elasticsearch7
Expand All @@ -31,7 +30,6 @@ deps =

postgres: psycopg2>=2.6
mysql: mysqlclient>=1.4,<2
elasticsearch2: elasticsearch>=2,<3
elasticsearch5: elasticsearch>=5,<6
elasticsearch5: certifi
elasticsearch6: elasticsearch>=6.4.0,<7
Expand Down
Loading

0 comments on commit 6e1e362

Please sign in to comment.