airflow.providers.opensearch.operators.opensearch¶
Classes¶
Run a query search against a given index on an OpenSearch cluster and returns results. |
|
Create a new index on an OpenSearch cluster with a given index name. |
|
Add a new document to a given Index or overwrite an existing one. |
Module Contents¶
- class airflow.providers.opensearch.operators.opensearch.OpenSearchQueryOperator(*, query=None, search_object=None, index_name=None, opensearch_conn_id='opensearch_default', opensearch_conn_class=RequestsHttpConnection, log_query=True, **kwargs)[source]¶
Bases:
airflow.models.BaseOperator
Run a query search against a given index on an OpenSearch cluster and returns results.
See also
For more information on how to use this operator, take a look at the guide: Run a query against an OpenSearch Index
- Parameters:
query (dict | None) – A Dictionary OpenSearch DSL query.
search_object (Any | None) – A Search object from opensearch-dsl.
index_name (str | None) – The name of the index to search for documents.
opensearch_conn_id (str) – opensearch connection to use
opensearch_conn_class (type[opensearchpy.Connection] | None) – opensearch connection class to use
log_query (bool) – Whether to log the query used. Defaults to True and logs query used.
- template_fields: collections.abc.Sequence[str] = ['query'][source]¶
- property hook: airflow.providers.opensearch.hooks.opensearch.OpenSearchHook[source]¶
Get an instance of an OpenSearchHook.
- class airflow.providers.opensearch.operators.opensearch.OpenSearchCreateIndexOperator(*, index_name, index_body, opensearch_conn_id='opensearch_default', **kwargs)[source]¶
Bases:
airflow.models.BaseOperator
Create a new index on an OpenSearch cluster with a given index name.
See also
For more information on how to use this operator, take a look at the guide: Create an Index in OpenSearch
- Parameters:
- property hook: airflow.providers.opensearch.hooks.opensearch.OpenSearchHook[source]¶
Get an instance of an OpenSearchHook.
- class airflow.providers.opensearch.operators.opensearch.OpenSearchAddDocumentOperator(*, index_name=None, document=None, doc_id=None, doc_class=None, opensearch_conn_id='opensearch_default', **kwargs)[source]¶
Bases:
airflow.models.BaseOperator
Add a new document to a given Index or overwrite an existing one.
See also
For more information on how to use this operator, take a look at the guide: Add a Document to an Index on OpenSearch
- Parameters:
index_name (str | None) – The name of the index to put the document.
document (dict[str, Any] | None) – A dictionary representation of the document.
document_id – The id for the document in the index.
doc_class (Any | None) – A Document subclassed object using opensearch-dsl
opensearch_conn_id (str) – opensearch connection to use
- property hook: airflow.providers.opensearch.hooks.opensearch.OpenSearchHook[source]¶
Get an instance of an OpenSearchHook.