# Excluding fields from results

**URL:** <https://discuss.elastic.co/t/excluding-fields-from-results/5638>\
**Category:** Elasticsearch\
**Created:** [October 19, 2011, 8:00am UTC](https://discuss.elastic.co/t/excluding-fields-from-results/5638 "2011-10-19T08:00:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Reelsen](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexander\_Reelsen](https://discuss.elastic.co/u/Alexander_Reelsen)\
**Post date:** [October 19, 2011, 8:00am UTC](https://discuss.elastic.co/t/excluding-fields-from-results/5638/1 "2011-10-19T08:00:07Z")

</div>

Hi there,

I just checked the docs, and it is possible to include only some  
fields in the response instead of the whole \_source variable. See  
[http://www.elasticsearch.org/guide/reference/api/search/fields.html](http://www.elasticsearch.org/guide/reference/api/search/fields.html)

I'd like to do it vice versa: Is it possible to exclude certain fields  
instead of including?

And the next thing which wonders me is the fact, that a new JSON  
variable is created instead of \_source called fields. Do I have any  
influence on this name? I'd like not to change the frontend code  
relying on the structure of the JSON 🙂

Thanks for helping and have a nice day!

--Alexander

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 19, 2011, 9:03pm UTC](https://discuss.elastic.co/t/excluding-fields-from-results/5638/2 "2011-10-19T21:03:02Z")

</div>

No, you can't exclude fields, and you can't change the names.

On Wed, Oct 19, 2011 at 10:00 AM, Alexander Reelsen \<  
[alexander.reelsen@googlemail.com](mailto:alexander.reelsen@googlemail.com)\> wrote:

> Hi there,
> 
> I just checked the docs, and it is possible to include only some  
> fields in the response instead of the whole \_source variable. See  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/fields.html)
> 
> I'd like to do it vice versa: Is it possible to exclude certain fields  
> instead of including?
> 
> And the next thing which wonders me is the fact, that a new JSON  
> variable is created instead of \_source called fields. Do I have any  
> influence on this name? I'd like not to change the frontend code  
> relying on the structure of the JSON 🙂
> 
> Thanks for helping and have a nice day!
> 
> --Alexander

---

<div class="post-metadata">

**Author:** ![Daniel\_Ferreira](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@Daniel\_Ferreira](https://discuss.elastic.co/u/Daniel_Ferreira)\
**Post date:** [October 31, 2011, 4:50pm UTC](https://discuss.elastic.co/t/excluding-fields-from-results/5638/3 "2011-10-31T16:50:31Z")

</div>

And can we use the mapping in order to obtain the same result? instead of exclude in query time exclude in indexing time?

Thanks

---

<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, 3:50am UTC](https://discuss.elastic.co/t/excluding-fields-from-results/5638/4 "2017-07-06T03:50:24Z")

</div>


