From 6fe9d0a23ae2362456c7ca4f7d0034d7119fe746 Mon Sep 17 00:00:00 2001 From: Andrew Bunker Date: Mon, 1 Jun 2020 15:12:56 -0400 Subject: [PATCH] Add note about Elasticsearch backend credentials to docs (#6097) --- CONTRIBUTORS.rst | 1 + docs/topics/search/backends.rst | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index f88312dedf..f5097dc352 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -465,6 +465,7 @@ Contributors * Dan Bentley * GTpyro * Yngve Høiseth +* Andrew Bunker Translators =========== diff --git a/docs/topics/search/backends.rst b/docs/topics/search/backends.rst index e1de2d0127..5caaed6122 100644 --- a/docs/topics/search/backends.rst +++ b/docs/topics/search/backends.rst @@ -143,6 +143,18 @@ The backend is configured in settings: Other than ``BACKEND``, the keys are optional and default to the values shown. Any defined key in ``OPTIONS`` is passed directly to the Elasticsearch constructor as case-sensitive keyword argument (e.g. ``'max_retries': 1``). +A username and password may be optionally be supplied to the ``URL`` field to provide authentication credentials for the Elasticsearch service: + +.. code-block:: python + + WAGTAILSEARCH_BACKENDS = { + 'default': { + ... + 'URLS': ['http://username:password@localhost:9200'], + ... + } + } + ``INDEX_SETTINGS`` is a dictionary used to override the default settings to create the index. The default settings are defined inside the ``ElasticsearchSearchBackend`` class in the module ``wagtail/wagtail/wagtailsearch/backends/elasticsearch.py``. Any new key is added, any existing key, if not a dictionary, is replaced with the new value. Here's a sample on how to configure the number of shards and setting the Italian LanguageAnalyzer as the default analyzer: .. code-block:: python