023cf5380f: "[7.x] Document 'UnsupportedProductError'"d381491482: "[7.x] Rename product error to 'UnsupportedProductError'"b56fbcb155: "Document the Elasticsearch product check"b63d005138: "Don't swallow unexpected errors during Elasticsearch verification"801a839093: "Verify we're connected to Elasticsearch before requests" Signed-off-by: Shephali Mittal <shephalm@amazon.com>
43 lines
1.1 KiB
ReStructuredText
43 lines
1.1 KiB
ReStructuredText
.. _transports:
|
|
|
|
Transport classes
|
|
=================
|
|
|
|
List of transport classes that can be used, simply import your choice and pass
|
|
it to the constructor of :class:`~elasticsearch.Elasticsearch` as
|
|
`connection_class`. Note that the
|
|
:class:`~elasticsearch.connection.RequestsHttpConnection` requires ``requests``
|
|
to be installed.
|
|
|
|
For example to use the ``requests``-based connection just import it and use it:
|
|
|
|
.. code-block:: python
|
|
|
|
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.
|
|
|
|
|
|
.. py:module:: elasticsearch.connection
|
|
|
|
Connection
|
|
----------
|
|
|
|
.. autoclass:: Connection
|
|
|
|
Urllib3HttpConnection
|
|
---------------------
|
|
|
|
.. autoclass:: Urllib3HttpConnection
|
|
|
|
|
|
RequestsHttpConnection
|
|
----------------------
|
|
|
|
.. autoclass:: RequestsHttpConnection
|
|
|