# Es spark ignoring fields query parameter

**URL:** <https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493>\
**Category:** Elasticsearch\
**Created:** [April 30, 2015, 2:02pm UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493 "2015-04-30T14:02:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![israel](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@israel](https://discuss.elastic.co/u/israel)\
**Post date:** [April 30, 2015, 2:02pm UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493/1 "2015-04-30T14:02:58Z")

</div>

Hi,

I am using es-spark\_2.11-2.1.0.Beta4 on Spark 1.3.1 shell against  
elasticsearch 1.4.4.

Doing:

import org.elasticsearch.spark.\_

val esRdd = sc.esRDD("my\_index/my\_type?q=fields:field\_name")

esRdd.take(1)

results in getting the whole document source and not just the specified  
field.

Thanks for the help.

Israel

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [April 30, 2015, 2:47pm UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493/2 "2015-04-30T14:47:08Z")

</div>

To specify the query, use es.query param or the second string param in  
esRDD. The doc provide detailed information.

In a future version, we'll throw an exception if a query is specified in  
the index.  
On Apr 30, 2015 5:03 PM, "Israel Klein" [israel.klein@gmail.com](mailto:israel.klein@gmail.com) wrote:

> Hi,
> 
> I am using es-spark\_2.11-2.1.0.Beta4 on Spark 1.3.1 shell against  
> elasticsearch 1.4.4.
> 
> Doing:
> 
> import org.elasticsearch.spark.\_
> 
> val esRdd = sc.esRDD("my\_index/my\_type?q=fields:field\_name")
> 
> esRdd.take(1)
> 
> results in getting the whole document source and not just the specified  
> field.
> 
> Thanks for the help.
> 
> Israel
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJogdmdaDcU%3DkNY6XxH%2BHjZ%2BUs7QXjBv326HeQhCp9PExZW-0Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJogdmdaDcU%3DkNY6XxH%2BHjZ%2BUs7QXjBv326HeQhCp9PExZW-0Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![israel](https://avatars.discourse-cdn.com/v4/letter/i/b77776/32.png) [@israel](https://discuss.elastic.co/u/israel)\
**Post date:** [April 30, 2015, 3:28pm UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493/3 "2015-04-30T15:28:23Z")

</div>

Hi Costin,

It was my mistake in the question. First I have tried the above and it did  
not work at all(obviously) but then I have tried  
val esRdd = sc.esRDD("my\_index/my\_type"," ?fields=field\_name") as well with  
the mentioned above result.

On Thursday, April 30, 2015 at 5:47:15 PM UTC+3, Costin Leau wrote:

> To specify the query, use es.query param or the second string param in  
> esRDD. The doc provide detailed information.
> 
> In a future version, we'll throw an exception if a query is specified in  
> the index.  
> On Apr 30, 2015 5:03 PM, "Israel Klein" \<[israel...@gmail.com](mailto:israel...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi,
> > 
> > I am using es-spark\_2.11-2.1.0.Beta4 on Spark 1.3.1 shell against  
> > elasticsearch 1.4.4.
> > 
> > Doing:
> > 
> > import org.elasticsearch.spark.\_
> > 
> > val esRdd = sc.esRDD("my\_index/my\_type?q=fields:field\_name")
> > 
> > esRdd.take(1)
> > 
> > results in getting the whole document source and not just the specified  
> > field.
> > 
> > Thanks for the help.
> > 
> > Israel
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6e87a23a-dd16-4a62-901b-87514c568269%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6e87a23a-dd16-4a62-901b-87514c568269%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![costin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/costin/32/44950_2.png) [@costin](https://discuss.elastic.co/u/costin)\
**Post date:** [April 30, 2015, 7:22pm UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493/4 "2015-04-30T19:22:27Z")

</div>

Please raise an issue (more info about what's needed can be found here [1]).

Cheers,

[1] [Troubleshooting | Elasticsearch for Apache Hadoop [master] | Elastic](http://www.elastic.co/guide/en/elasticsearch/hadoop/master/troubleshooting.html#help)

On Thu, Apr 30, 2015 at 6:28 PM, Israel Klein [israel.klein@gmail.com](mailto:israel.klein@gmail.com) wrote:

> Hi Costin,
> 
> It was my mistake in the question. First I have tried the above and it did  
> not work at all(obviously) but then I have tried  
> val esRdd = sc.esRDD("my\_index/my\_type"," ?fields=field\_name") as well with  
> the mentioned above result.
> 
> On Thursday, April 30, 2015 at 5:47:15 PM UTC+3, Costin Leau wrote:
> 
> > To specify the query, use es.query param or the second string param in  
> > esRDD. The doc provide detailed information.
> > 
> > In a future version, we'll throw an exception if a query is specified in  
> > the index.
> > 
> > On Apr 30, 2015 5:03 PM, "Israel Klein" [israel...@gmail.com](mailto:israel...@gmail.com) wrote:
> > 
> > > Hi,
> > > 
> > > I am using es-spark\_2.11-2.1.0.Beta4 on Spark 1.3.1 shell against  
> > > elasticsearch 1.4.4.
> > > 
> > > Doing:
> > > 
> > > import org.elasticsearch.spark.\_
> > > 
> > > val esRdd = sc.esRDD("my\_index/my\_type?q=fields:field\_name")
> > > 
> > > esRdd.take(1)
> > > 
> > > results in getting the whole document source and not just the specified  
> > > field.
> > > 
> > > Thanks for the help.
> > > 
> > > Israel
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d1e7fb54-bf2c-4a8a-a65c-e8d20cd58337%40googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/6e87a23a-dd16-4a62-901b-87514c568269%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6e87a23a-dd16-4a62-901b-87514c568269%40googlegroups.com).
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAJogdmeWs5jDn1HDO2sBJMSmZftes3QxjSFszcs54CZ\_D1%2BQLg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJogdmeWs5jDn1HDO2sBJMSmZftes3QxjSFszcs54CZ_D1%2BQLg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:16am UTC](https://discuss.elastic.co/t/es-spark-ignoring-fields-query-parameter/23493/5 "2017-07-06T00:16:35Z")

</div>


