Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 1.05 KB

transports.rst

File metadata and controls

40 lines (25 loc) · 1.05 KB

Transport classes

List of transport classes that can be used, simply import your choice and pass it to the constructor of ~elasticsearch.Elasticsearch as connection_class. Note that the ~elasticsearch.connection.RequestsHttpConnection requires requests to be installed.

For example to use the requests-based connection just import it and use it:

from elasticsearch import Elasticsearch, RequestsHttpConnection
es = Elasticsearch(connection_class=RequestsHttpConnection)

The default connection class is based on urllib3 which is more performant and lightweight than the optional requests-based class. Only use RequestsHttpConnection if you have need of any of requests advanced features like custom auth plugins etc.

Connection

Connection

Urllib3HttpConnection

Urllib3HttpConnection

RequestsHttpConnection

RequestsHttpConnection