# How can I fetch only one field with pyes?

**URL:** <https://discuss.elastic.co/t/how-can-i-fetch-only-one-field-with-pyes/14149>\
**Category:** Elasticsearch\
**Created:** [October 29, 2013, 4:12am UTC](https://discuss.elastic.co/t/how-can-i-fetch-only-one-field-with-pyes/14149 "2013-10-29T04:12:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raymond\_Wang](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Raymond\_Wang](https://discuss.elastic.co/u/Raymond_Wang)\
**Post date:** [October 29, 2013, 4:12am UTC](https://discuss.elastic.co/t/how-can-i-fetch-only-one-field-with-pyes/14149/1 "2013-10-29T04:12:17Z")

</div>

there are many fields in document, but I want to get only one filed. How  
can I specify the condition with pyes?

i tried:

fields=["ip"]  
result = conn.search(query=q, indices=[index\_name], fields=fields)

but failed.

any help would be appreciated.

--  
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:10am UTC](https://discuss.elastic.co/t/how-can-i-fetch-only-one-field-with-pyes/14149/2 "2017-07-06T02:10:04Z")

</div>


