| :py:mod:`airflow.providers.elasticsearch.hooks.elasticsearch` |
| ============================================================= |
| |
| .. py:module:: airflow.providers.elasticsearch.hooks.elasticsearch |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook |
| airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchHook |
| airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchPythonHook |
| |
| |
| |
| |
| .. py:class:: ElasticsearchSQLHook(schema = 'http', connection = None, *args, **kwargs) |
| |
| Bases: :py:obj:`airflow.providers.common.sql.hooks.sql.DbApiHook` |
| |
| Interact with Elasticsearch through the elasticsearch-dbapi. |
| |
| This hook uses the Elasticsearch conn_id. |
| |
| :param elasticsearch_conn_id: The :ref:`ElasticSearch connection id <howto/connection:elasticsearch>` |
| used for Elasticsearch credentials. |
| |
| .. py:attribute:: conn_name_attr |
| :annotation: = elasticsearch_conn_id |
| |
| |
| |
| .. py:attribute:: default_conn_name |
| :annotation: = elasticsearch_default |
| |
| |
| |
| .. py:attribute:: conn_type |
| :annotation: = elasticsearch |
| |
| |
| |
| .. py:attribute:: hook_name |
| :annotation: = Elasticsearch |
| |
| |
| |
| .. py:method:: get_conn() |
| |
| Returns a elasticsearch connection object |
| |
| |
| .. py:method:: get_uri() |
| |
| Extract the URI from the connection. |
| |
| :return: the extracted uri. |
| |
| |
| |
| .. py:class:: ElasticsearchHook(*args, **kwargs) |
| |
| Bases: :py:obj:`ElasticsearchSQLHook` |
| |
| This class is deprecated and was renamed to ElasticsearchSQLHook. |
| Please use `airflow.providers.elasticsearch.hooks.elasticsearch.ElasticsearchSQLHook`. |
| |
| |
| .. py:class:: ElasticsearchPythonHook(hosts, es_conn_args = None) |
| |
| Bases: :py:obj:`airflow.hooks.base.BaseHook` |
| |
| Interacts with Elasticsearch. This hook uses the official Elasticsearch Python Client. |
| |
| :param hosts: list: A list of a single or many Elasticsearch instances. Example: ["http://localhost:9200"] |
| :param es_conn_args: dict: Additional arguments you might need to enter to connect to Elasticsearch. |
| Example: {"ca_cert":"/path/to/cert", "basic_auth": "(user, pass)"} |
| |
| .. py:method:: get_conn() |
| |
| Returns the Elasticsearch client (cached) |
| |
| |
| .. py:method:: search(query, index = '_all') |
| |
| Returns results matching a query using Elasticsearch DSL |
| |
| :param index: str: The index you want to query |
| :param query: dict: The query you want to run |
| |
| :returns: dict: The response 'hits' object from Elasticsearch |
| |
| |
| |