class_docstr: 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)"}
class_docstr_tok: ["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",")","''","}"]
docstr: Return 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
docstr_tok: ["Return","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"]
code: def search(self, query: dict[Any, Any], index: str = "_all") -> dict:
      """
      Return 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
      """
      es_client = self.get_conn
      result = es_client.search(index=index, body=query)
      return result["hits"]
  
imports: from __future__ import annotations
  import warnings
  from functools import cached_property
  from typing import TYPE_CHECKING, Any
  from urllib import parse
  from elasticsearch import Elasticsearch
  from airflow.exceptions import AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
  from airflow.providers.common.sql.hooks.sql import DbApiHook
label_desc: Use image node_id 4 for calling the ElasticsearchPythonHook obj's underlying member method code with example usage: obj.search(query, index) and returns: result