Selaa lähdekoodia

Add note about Elasticsearch backend credentials to docs (#6097)

Andrew Bunker 4 vuotta sitten
vanhempi
commit
6fe9d0a23a
2 muutettua tiedostoa jossa 13 lisäystä ja 0 poistoa
  1. 1 0
      CONTRIBUTORS.rst
  2. 12 0
      docs/topics/search/backends.rst

+ 1 - 0
CONTRIBUTORS.rst

@@ -465,6 +465,7 @@ Contributors
 * Dan Bentley
 * GTpyro
 * Yngve Høiseth
+* Andrew Bunker
 
 Translators
 ===========

+ 12 - 0
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