# Trouble getting fields to work consistently across different clients

**URL:** <https://discuss.elastic.co/t/trouble-getting-fields-to-work-consistently-across-different-clients/11823>\
**Category:** Elasticsearch\
**Created:** [May 5, 2013, 6:51pm UTC](https://discuss.elastic.co/t/trouble-getting-fields-to-work-consistently-across-different-clients/11823 "2013-05-05T18:51:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don\_2](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@Don\_2](https://discuss.elastic.co/u/Don_2)\
**Post date:** [May 5, 2013, 6:51pm UTC](https://discuss.elastic.co/t/trouble-getting-fields-to-work-consistently-across-different-clients/11823/1 "2013-05-05T18:51:24Z")

</div>

Running 0.90.0 GA, I have been unable to get the fields parameter to work  
in the es-head plugin or firefox RESTClient, although it seems to work from  
curl using a slightly different syntax:

curl -XGET "[http://myinstance:9200/myindex/mytype/\_search?pretty](http://myinstance:9200/myindex/mytype/_search?pretty)" -d '  
{"fields": ["my.field.to.show"]}, "query" : { "term" :{  
"my.field.search":"something"}}}'

This returns results with a "fields" : { "my.field.to.show"...} result.

The same query in the es-head plugin won't validate, but this will,  
although it only returns \_source and no fields value:  
{  
"fields": [  
"my.field.to.show"  
],  
"query": {  
"term": {  
"my.field.to.search": "something"  
}  
}  
}

The original query (that works) yields "JSON.parse: unexpected  
non-whitespace character after JSON data" in ES Search.

Same query in RESTClient fails to return a fields object.

Any ideas?

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:38am UTC](https://discuss.elastic.co/t/trouble-getting-fields-to-work-consistently-across-different-clients/11823/2 "2017-07-06T02:38:12Z")

</div>


