# Difference between \_source and fields projections

**URL:** <https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927>\
**Category:** Elasticsearch\
**Created:** [March 26, 2015, 5:20pm UTC](https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927 "2015-03-26T17:20:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Udi\_Ben\_Amitai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/udi_ben_amitai/32/805_2.png) [@Udi\_Ben\_Amitai](https://discuss.elastic.co/u/Udi_Ben_Amitai)\
**Post date:** [March 26, 2015, 5:20pm UTC](https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927/1 "2015-03-26T17:20:41Z")

</div>

Hi,  
My question is about the performance (or other) impact of the difference  
between \_source and fields projection.  
These 2 queries return (at least in my perspective) an equivalent result:  
{"\_source":{"include":["name"]}}  
==\> {... "\_source":{"name":"blah"}}  
and:  
{"fields":["name"]}  
==\>{... "fields":{"name":"blah"}}

In cases where the \_source is stored -  
Is there a preference to one of the approaches?  
performance/memory/functional wise?

Thanks,  
Udi

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3fada4a4-d80a-43b9-b256-f93987177d87%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3fada4a4-d80a-43b9-b256-f93987177d87%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Felipe\_Santos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felipe_santos/32/3511_2.png) [@Felipe\_Santos](https://discuss.elastic.co/u/Felipe_Santos)\
**Post date:** [July 14, 2015, 10:43pm UTC](https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927/2 "2015-07-14T22:43:20Z")

</div>

I would like to know the difference too

---

<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:** [July 14, 2015, 11:03pm UTC](https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927/3 "2015-07-14T23:03:44Z")

</div>

Generally you should prefer \_source. They are different but not much  
different. Fields is for loading stored fields and source is for filtering  
source. The funky thing is that one can simulate the other pretty well.

---

<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, 12:01am UTC](https://discuss.elastic.co/t/difference-between--source-and-fields-projections/22927/4 "2017-07-06T00:01:27Z")

</div>


