# Removing \_source tag from results?

**URL:** <https://discuss.elastic.co/t/removing--source-tag-from-results/81347>\
**Category:** Elasticsearch\
**Created:** [April 5, 2017, 5:11pm UTC](https://discuss.elastic.co/t/removing--source-tag-from-results/81347 "2017-04-05T17:11:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeroen1](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeroen1](https://discuss.elastic.co/u/jeroen1)\
**Post date:** [April 5, 2017, 5:11pm UTC](https://discuss.elastic.co/t/removing--source-tag-from-results/81347/1 "2017-04-05T17:11:06Z")

</div>

I'd like to minimize the query output that ES generates to the essentials only. To do this, I'm using filter\_query = hits.total,hits.hits.\_source.email,hits.hits.\_source.name. This works as expected, stripping fields like \_score, \_index and \_id:

```auto
{
      "_source": {
        "email": "jeroen@topsecret.xxx",
        "name": "jeroen1"
      }
}

```

However, I want to get rid of \_source as well, ending up with:

```auto
{
        "email": "jeroen@topsecret.xxx",
        "name": "jeroen1"
}

```

How can I do this? Thanks!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 5, 2017, 5:46pm UTC](https://discuss.elastic.co/t/removing--source-tag-from-results/81347/2 "2017-04-05T17:46:21Z")

</div>

First: wrap code in ` and code blocks in ``` so they are easier to read.

Second: there isn't a generic transformation like that available that I know of. In general the other options around what fields are returned are about not having to load or deserialize them, not how they look.

---

<div class="post-metadata">

**Author:** ![jeroen1](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jeroen1](https://discuss.elastic.co/u/jeroen1)\
**Post date:** [April 5, 2017, 5:56pm UTC](https://discuss.elastic.co/t/removing--source-tag-from-results/81347/3 "2017-04-05T17:56:01Z")

</div>

Code blocks inserted, sorry.

---

<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:** [May 3, 2017, 5:56pm UTC](https://discuss.elastic.co/t/removing--source-tag-from-results/81347/4 "2017-05-03T17:56:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
