# \_source vs stored fields

**URL:** <https://discuss.elastic.co/t/-source-vs-stored-fields/8025>\
**Category:** Elasticsearch\
**Created:** [June 8, 2012, 8:00pm UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025 "2012-06-08T20:00:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [June 8, 2012, 8:00pm UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025/1 "2012-06-08T20:00:32Z")

</div>

Hi,

ElasticSearch supports two ways of storing data. Every field has a store  
option and there is a special \_source fields which stores the original JSON.

I was wondering what are the rule thumbs to choose the one over the other  
(or both?) - performance being the most important factor.

Our application needs to support for two main use cases:

1. Straight forward searching, where full documents are returned, with hit  
highlighting.
2. Faceting where we need access to document tokens and metadata fields  
like date.

Thanks for your advice,  
Boaz

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 8, 2012, 9:58pm UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025/2 "2012-06-08T21:58:24Z")

</div>

Hi Boaz

> Our application needs to support for two main use cases:
> 
> 1. Straight forward searching, where full documents are returned, with  
> hit highlighting.
> 2. Faceting where we need access to document tokens and metadata  
> fields like date.

You don't need \_stored fields for either of these. Also, take a look  
at:  
[https://groups.google.com/d/topic/elasticsearch/j8cfbv-j73g/discussion](https://groups.google.com/d/topic/elasticsearch/j8cfbv-j73g/discussion)

clint

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [June 9, 2012, 11:27am UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025/3 "2012-06-09T11:27:20Z")

</div>

Hi Clint,

Thank you for the reply. I was wondering how this relates to the field  
cache - does it store the content of the \_source field or does store the  
tokenized version of regular fields (or maybe I'm completely off thinking  
it's related).

Cheers,  
Boaz

On Friday, June 8, 2012 11:58:24 PM UTC+2, Clinton Gormley wrote:

> Hi Boaz
> 
> > Our application needs to support for two main use cases:
> > 
> > 1. Straight forward searching, where full documents are returned, with  
> > hit highlighting.
> > 2. Faceting where we need access to document tokens and metadata  
> > fields like date.
> 
> You don't need \_stored fields for either of these. Also, take a look  
> at:  
> [https://groups.google.com/d/topic/elasticsearch/j8cfbv-j73g/discussion](https://groups.google.com/d/topic/elasticsearch/j8cfbv-j73g/discussion)
> 
> clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 10, 2012, 10:06am UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025/4 "2012-06-10T10:06:18Z")

</div>

Hi Boaz

> Thank you for the reply. I was wondering how this relates to the field  
> cache - does it store the content of the \_source field or does store  
> the tokenized version of regular fields (or maybe I'm completely off  
> thinking it's related).

As I understand it, the field cache stores tokens, so the \_source field  
or store parameter are irrelevant, as both of these just store the  
original value, not the tokenized value.

clint

---

<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:25am UTC](https://discuss.elastic.co/t/-source-vs-stored-fields/8025/5 "2017-07-06T03:25:03Z")

</div>


