airflow.providers.elasticsearch.log.es_response
¶
Module Contents¶
Classes¶
Helper class to provide attribute like access to List objects. |
|
Helper class to provide attribute like access to Dictionary objects. |
|
The Hit class is used to manage and access elements in a document. |
|
The HitMeta class is used to manage and access metadata of a document. |
|
The ElasticSearchResponse class is used to manage and access the response from an Elasticsearch search. |
- class airflow.providers.elasticsearch.log.es_response.AttributeList(_list)[source]¶
Helper class to provide attribute like access to List objects.
- class airflow.providers.elasticsearch.log.es_response.AttributeDict(d)[source]¶
Helper class to provide attribute like access to Dictionary objects.
- class airflow.providers.elasticsearch.log.es_response.Hit(document)[source]¶
Bases:
AttributeDict
The Hit class is used to manage and access elements in a document.
It inherits from the AttributeDict class and provides attribute-like access to its elements, similar to a dictionary.
- class airflow.providers.elasticsearch.log.es_response.HitMeta(document, exclude=('_source', '_fields'))[source]¶
Bases:
AttributeDict
The HitMeta class is used to manage and access metadata of a document.
This class inherits from the AttributeDict class and provides attribute-like access to its elements.
- class airflow.providers.elasticsearch.log.es_response.ElasticSearchResponse(search, response, doc_class=None)[source]¶
Bases:
AttributeDict
The ElasticSearchResponse class is used to manage and access the response from an Elasticsearch search.
This class can be iterated over directly to access hits in the response. Indexing the class instance with an integer or slice will also access the hits. The class also evaluates to True if there are any hits in the response.
The hits property returns an AttributeList of hits in the response, with each hit transformed into an instance of the doc_class if provided.
The response parameter stores the dictionary returned by the Elasticsearch client search method.
- property hits: list[Hit][source]¶
This property provides access to the hits (i.e., the results) of the Elasticsearch response.
The hits are represented as an AttributeList of Hit instances, which allow for easy, attribute-like access to the hit data.
The hits are lazily loaded, meaning they’re not processed until this property is accessed. Upon first access, the hits data from the response is processed using the _get_result method of the associated Search instance (i.e. an instance from ElasticsearchTaskHandler class), and the results are stored for future accesses.
Each hit also includes all the additional data present in the “hits” field of the response, accessible as attributes of the hit.