title: create new SparkSession for different query?
body: <p>I'd like to get two data from elasticsearch</p>
  
  <p>One is filtered with a query, another has no filter.</p>
  
  <pre><code> // with query
   session = get_spark_session(query=query)
  
   df = session.read.option(
       "es.resource", "analytics-prod-2019.08.02"
   ).format("org.elasticsearch.spark.sql").load()
  
  
   df.show() // empty result
  
   // without query
   session = get_spark_session()
  
   df = session.read.option(
       "es.resource", "analytics-prod-2019.08.02"
   ).format("org.elasticsearch.spark.sql").load()
  
   df.show() // empty result
  
  
   def get_spark_session(query=None, excludes=[]):
  
       conf = pyspark.SparkConf()
       conf.set("spark.driver.allowMultipleContexts", "true")
       conf.set("es.index.auto.create", "true")
       conf.set("es.nodes.discovery", "true")
       conf.set("es.scroll.size", 10000)
       conf.set("es.read.field.exclude", excludes)
       conf.set("spark.driver.extraClassPath", "/usr/local/elasticsearch-hadoop/dist/elasticsearch-spark-20_2.11-6.6.2.jar")
       if query:
           conf.set("es.query", query)
  
  
       sc = SparkSession.builder.config(conf=conf).getOrCreate()
  
       return sc 
  </code></pre>
  
  <p>The question is whether the session is reused or not..</p>
  
  <p>When I run <code>filtered</code> query first, and <code>non-filtered</code> query second, 
  both gives empty result</p>
  
  <p>But when I run <code>non-filtered</code> query first, it shows some results, and the subsequent <code>filtered</code> query shows empty result.</p>
  
  <pre><code> // below, I reverse the order
   // without query
   session = get_spark_session()
  
   df = session.read.option(
       "es.resource", "analytics-prod-2019.08.02"
   ).format("org.elasticsearch.spark.sql").load()
  
   df.show() // some result
  
   // with query
   session = get_spark_session(query=query)
  
   df = session.read.option(
       "es.resource", "analytics-prod-2019.08.02"
   ).format("org.elasticsearch.spark.sql").load()
  
  
   df.show() // empty result
  </code></pre>
  
  <p>** edit</p>
  
  <p>So I can get desired result with the following:</p>
  
  <pre><code>def get_spark_session(query=None, excludes=[]):
  
      conf = pyspark.SparkConf()
      conf.set("spark.driver.allowMultipleContexts", "true")
      conf.set("es.index.auto.create", "true")
      conf.set("es.nodes.discovery", "true")
      conf.set("es.scroll.size", 10000)
      conf.set("es.read.field.exclude", excludes)
      conf.set("spark.driver.extraClassPath", "/usr/local/elasticsearch-hadoop/dist/elasticsearch-spark-20_2.11-6.6.2.jar")
      if query:
          conf.set("es.query", query)
      else:
          conf.set("es.query", "") # unset the query 
  </code></pre>