# ES 2.0: excluding from source, but storing attachment, then retrieve via 'fields'

**URL:** <https://discuss.elastic.co/t/es-2-0-excluding-from-source-but-storing-attachment-then-retrieve-via-fields/34560>\
**Category:** Elasticsearch\
**Created:** [November 13, 2015, 8:28pm UTC](https://discuss.elastic.co/t/es-2-0-excluding-from-source-but-storing-attachment-then-retrieve-via-fields/34560 "2015-11-13T20:28:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![twigbranch](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@twigbranch](https://discuss.elastic.co/u/twigbranch)\
**Post date:** [November 13, 2015, 8:28pm UTC](https://discuss.elastic.co/t/es-2-0-excluding-from-source-but-storing-attachment-then-retrieve-via-fields/34560/1 "2015-11-13T20:28:05Z")

</div>

In ES 1.5 I was able to exclude an attachment from \_source, but store it, so that the encoded text would not be stored, but the plain text would be. I could then access the text via 'fields' when running a query, i.e.  
MyModel.search(query: { query\_string: { query: "search text" } }, fields: ['\_source', 'my\_attachment']).

Now, in ES 2.0, I don't see any fields hash in the response. And I don't see the attachment text.

Is what I was doing still possible somehow with ES 2.0?

---

<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 5, 2017, 11:38pm UTC](https://discuss.elastic.co/t/es-2-0-excluding-from-source-but-storing-attachment-then-retrieve-via-fields/34560/2 "2017-07-05T23:38:33Z")

</div>


