Performing requests

In fact, all requests are sent by the transport client in the transport attribute. Let's take a look at the get() method of IndicesClient (for reference, see https://github.com/elastic/elasticsearch-py/blob/master/elasticsearch/client/indices.py), as shown in the following code block:

def get(self, index, feature=None, params=None):    if index in SKIP_IN_PATH:        raise ValueError(            "Empty value passed for a required argument 'index'.")    return self.transport.perform_request(                "GET", _make_path(index, feature), params=params)

We can see that the actual method call to send out the request is the perform_request() method of the transport attribute in the Elasticsearch object. The direct request methods are working in the same way. ...

Get Advanced Elasticsearch 7.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.