title: Reading ES from spark with elasticsearch-spark connector: all the fields are returned
body: <p>I've done some experiments in the spark-shell with the elasticsearch-spark connector. Invoking spark:</p>
  
  <pre><code>] $SPARK_HOME/bin/spark-shell --master local[2] --jars ~/spark/jars/elasticsearch-spark-20_2.11-5.1.2.jar
  </code></pre>
  
  <p>In the scala shell:</p>
  
  <pre><code>scala&gt; import org.elasticsearch.spark._
  scala&gt; val es_rdd = sc.esRDD("myindex/mytype",query="myquery")
  </code></pre>
  
  <p>It works well, the result contains the good records as specified in myquery. The only thing is that I get all the fields, even if I specify a subset of these fields in the query. Example:</p>
  
  <pre><code>myquery = """{"query":..., "fields":["a","b"], "size":10}"""
  </code></pre>
  
  <p>returns all the fields, not only a and b (BTW, I noticed that size parameter is not taken in account neither : result contains more than 10 records). Maybe it's important to add that fields are nested, a and b are actually doc.a and doc.b. </p>
  
  <p>Is it a bug in the connector or do I have the wrong syntax?</p>