fix host arg docs in the Elasticsearch class (#1069)

* updated the __init__ docs of the Elasticsearch class to reflect the fact that is possible to pass a string representing the URL of the host we want to connect to and not necessarily a list of hosts

* adds space between as and kwargs in Elasticsearch __init__ doc
This commit is contained in:
Francesco Vigliaturo
2019-12-16 14:36:34 +01:00
committed by GitHub
parent cc461fdc3c
commit d2a0cc62eb
+5 -5
View File
@@ -190,12 +190,12 @@ class Elasticsearch(object):
def __init__(self, hosts=None, transport_class=Transport, **kwargs): def __init__(self, hosts=None, transport_class=Transport, **kwargs):
""" """
:arg hosts: list of nodes we should connect to. Node should be a :arg hosts: list of nodes, or a single node, we should connect to.
dictionary ({"host": "localhost", "port": 9200}), the entire dictionary Node should be a dictionary ({"host": "localhost", "port": 9200}),
will be passed to the :class:`~elasticsearch.Connection` class as the entire dictionary will be passed to the :class:`~elasticsearch.Connection`
kwargs, or a string in the format of ``host[:port]`` which will be class as kwargs, or a string in the format of ``host[:port]`` which will be
translated to a dictionary automatically. If no value is given the translated to a dictionary automatically. If no value is given the
:class:`~elasticsearch.Urllib3HttpConnection` class defaults will be used. :class:`~elasticsearch.Connection` class defaults will be used.
:arg transport_class: :class:`~elasticsearch.Transport` subclass to use. :arg transport_class: :class:`~elasticsearch.Transport` subclass to use.