# Difference of \_all and \_source in elasticsearch?

**URL:** <https://discuss.elastic.co/t/difference-of--all-and--source-in-elasticsearch/74602>\
**Category:** Elasticsearch\
**Created:** [February 10, 2017, 5:50am UTC](https://discuss.elastic.co/t/difference-of--all-and--source-in-elasticsearch/74602 "2017-02-10T05:50:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [February 10, 2017, 5:50am UTC](https://discuss.elastic.co/t/difference-of--all-and--source-in-elasticsearch/74602/1 "2017-02-10T05:50:36Z")

</div>

Hi,

When a document is indexed the ES keep it in 2 ways:  
1)\_all : used for searching  
2)\_source : used for reindexing

When we index a document in Lucene, the values for each field are added to the inverted index for the associated field. Optionally, the original values may also be stored unchanged so that they can be retrieved later.

Here \_all and \_source is done by LUCENE . So, the inverted index is used for \_all . Original values are stored in \_source.

Correct me if my understanding is wrong?

Thanks..

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 11, 2017, 12:35am UTC](https://discuss.elastic.co/t/difference-of--all-and--source-in-elasticsearch/74602/2 "2017-02-11T00:35:30Z")

</div>

That's right.

---

<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:** [March 11, 2017, 12:36am UTC](https://discuss.elastic.co/t/difference-of--all-and--source-in-elasticsearch/74602/3 "2017-03-11T00:36:18Z")

</div>

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