@@ -56,9 +56,40 @@ class Elasticsearch(object):
56
56
Elasticsearch low-level client. Provides a straightforward mapping from
57
57
Python to ES REST endpoints.
58
58
59
- The instance has attributes `indices` and `cluster` that provide access to
60
- :class:`~elasticsearch.client.IndicesClient` and
61
- :class:`~elasticsearch.client.ClusterClient` instances respectively.
59
+ The instance has attributes `cat`, `cluster`, `indices`, `nodes` and
60
+ `snapshot` that provide access to instances of
61
+ :class:`~elasticsearch.client.CatClient`,
62
+ :class:`~elasticsearch.client.ClusterClient`,
63
+ :class:`~elasticsearch.client.IndicesClient`,
64
+ :class:`~elasticsearch.client.NodesClient` and
65
+ :class:`~elasticsearch.client.SnapshotClient` respectively. This is the
66
+ preferred (and only supported) way to get access to those classes and their
67
+ methods.
68
+
69
+ Some examples::
70
+
71
+ # create connection to localhost using the ThriftConnection and it's
72
+ # default port (9500)
73
+ es = Elasticsearch(connection_class=ThriftConnection)
74
+
75
+ # create connection that will automatically inspect the cluster to get
76
+ # the list of active nodes. Start with nodes 'esnode1' and 'esnode2'
77
+ es = Elasticsearch(
78
+ ['esnode1', 'esnode2'],
79
+ # sniff before doing anything
80
+ sniff_on_start=True,
81
+ # refresh nodes after a node fails to respond
82
+ sniff_on_connection_fail=True,
83
+ # and also every 60 seconds
84
+ sniffer_timeout=60
85
+ )
86
+
87
+ # connect to localhost directly and another node using SSL on port 443
88
+ # and an url_prefix
89
+ es = Elasticsearch([
90
+ {'host': 'localhost'},
91
+ {'host': 'othernode', 'port': 443, 'url_prefix': 'es', 'use_ssl': True},
92
+ ])
62
93
"""
63
94
def __init__ (self , hosts = None , transport_class = Transport , ** kwargs ):
64
95
"""
0 commit comments