class_docstr: Primary DataFrame-based loading data from elastic search interface,
  defining API to read data from ES to DataFrame.
docstr: Read the data from elastic search into DataFrame.
  
  :param esConfig: Dictionary which represents configuration for
         elastic search(eg. ip, port etc).
  :param esResource: resource file in elastic search.
  :param schema: Optional. Defines the schema of Spark dataframe.
          If each column in Es is single value, don't need set schema.
  :return: Spark DataFrame. Each row represents a document in ES.
code: def read_df(esConfig, esResource, schema=None):
      """
      Read the data from elastic search into DataFrame.
  
      :param esConfig: Dictionary which represents configuration for
             elastic search(eg. ip, port etc).
      :param esResource: resource file in elastic search.
      :param schema: Optional. Defines the schema of Spark dataframe.
              If each column in Es is single value, don't need set schema.
      :return: Spark DataFrame. Each row represents a document in ES.
      """
      sc = init_nncontext()
      spark = OrcaContext.get_spark_session()
  
      reader = spark.read.format("org.elasticsearch.spark.sql")
  
      for key in esConfig:
          reader.option(key, esConfig[key])
      if schema:
          reader.schema(schema)
  
      df = reader.load(esResource)
      return df
  
file_path: BigDL/python/orca/src/bigdl/orca/data/elastic_search.py
imports: from bigdl.orca import OrcaContext
  from bigdl.dllib.nncontext import init_nncontext
label_desc: Use image node_id 2 for calling the elastic_search obj's underlying member method code with example usage: obj.read_df(esConfig, esResource, schema) and returns: df