diff --git a/.travis.yml b/.travis.yml index f8657c47818..198504051d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,10 @@ python: - 3.6 dist: xenial +addons: + hosts: + - search + jobs: include: - python: 3.6 diff --git a/docs/development/search.rst b/docs/development/search.rst index 1b4eea9fdd8..770ff87ed42 100644 --- a/docs/development/search.rst +++ b/docs/development/search.rst @@ -11,6 +11,7 @@ Local Development Configuration Installing and running Elasticsearch ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + You need to install and run Elasticsearch_ version 6.3 on your local development machine. You can get the installation instructions `here `_. @@ -20,6 +21,8 @@ Otherwise, you can also start an Elasticsearch Docker container by running the f -e "discovery.type=single-node" \ docker.elastic.co/elasticsearch/elasticsearch:6.3.2 +You need to override the ``ES_HOSTS`` and ``ELASTICSEARCH_DSL`` settings to point to ``127.0.0.1:9200``. + Indexing into Elasticsearch ^^^^^^^^^^^^^^^^^^^^^^^^^^^ For using search, you need to index data to the Elasticsearch Index. Run ``reindex_elasticsearch`` diff --git a/docs/development/tests.rst b/docs/development/tests.rst index fa3f2e8db00..05d767699c2 100644 --- a/docs/development/tests.rst +++ b/docs/development/tests.rst @@ -35,8 +35,6 @@ you can also set the ``TOX_POSARGS`` environment variable to an empty string:: .. warning:: Running tests for search needs an Elasticsearch :ref:`instance running locally `. - If you are testing inside :ref:`docker compose `, - you'll need to override the ``ES_HOSTS`` and ``ELASTICSEARCH_DSL`` settings to point to ``search:9200`` instead. To target a specific environment:: diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index 154df9ba3d3..b517e0b5a04 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -491,10 +491,10 @@ def USE_PROMOS(self): # noqa ALLOW_ADMIN = True # Elasticsearch settings. - ES_HOSTS = ['127.0.0.1:9200'] + ES_HOSTS = ['search:9200'] ELASTICSEARCH_DSL = { 'default': { - 'hosts': '127.0.0.1:9200' + 'hosts': 'search:9200' }, } # Chunk size for elasticsearch reindex celery tasks diff --git a/readthedocs/settings/docker_compose.py b/readthedocs/settings/docker_compose.py index cca8f29ca52..f09e32705c5 100644 --- a/readthedocs/settings/docker_compose.py +++ b/readthedocs/settings/docker_compose.py @@ -46,11 +46,6 @@ class DockerBaseSettings(CommunityDevSettings): # Enable auto syncing elasticsearch documents ELASTICSEARCH_DSL_AUTOSYNC = True if 'SEARCH' in os.environ else False - ELASTICSEARCH_DSL = { - 'default': { - 'hosts': 'search:9200', - }, - } RTD_CLEAN_AFTER_BUILD = True