# Indexing fields without storing

**URL:** https://discuss.elastic.co/t/indexing-fields-without-storing/5776
**Category:** Elasticsearch
**Created:** [November 4, 2011, 3:42pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776 "2011-11-04T15:42:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Andrej](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@Andrej](https://discuss.elastic.co/u/Andrej)
#### Post date: [November 4, 2011, 3:42pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/1 "2011-11-04T15:42:08Z")

</div>

Maybe its simple or stupid, but I didnt find an answer to this  
question: Is there a way to index fields, but not to store them? I  
have large text fields where I just want to search for a word, but  
never really return the whole field. What would be a good (meaning  
memory efficient) way to do this?

Thanks in advance!  
Andrej

---

<div class="post-metadata">

### Author: ![Jeremie\_BORDIER1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremie_bordier1/32/2860_2.png) [@Jeremie\_BORDIER1](https://discuss.elastic.co/u/Jeremie_BORDIER1)
#### Post date: [November 4, 2011, 3:46pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/2 "2011-11-04T15:46:47Z")

</div>

On Fri, Nov 4, 2011 at 4:42 PM, Andrej Rosenheinrich  
[andrej.rosenheinrich@unister.de](mailto:andrej.rosenheinrich@unister.de) wrote:

> Maybe its simple or stupid, but I didnt find an answer to this  
> question: Is there a way to index fields, but not to store them? I  
> have large text fields where I just want to search for a word, but  
> never really return the whole field. What would be a good (meaning  
> memory efficient) way to do this?
> 
> Thanks in advance!  
> Andrej

Hello Andrej,

Fields are never stored on their own appart from \_source. Since 0.18  
it's possible to exclude fields from being stored in \_source. You can  
set this setting by manually defining the mappings before indexing,  
with a syntax similar to:

"mappings" : {  
"mytype" : {  
"\_source" : {  
"excludes" : ["content"]  
},  
...

HTH,  
Jérémie

--  
Jérémie 'ahFeel' BORDIER

---

<div class="post-metadata">

### Author: ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)
#### Post date: [November 4, 2011, 4:12pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/3 "2011-11-04T16:12:58Z")

</div>

Hello Andrej,

Jérémie I think what you say is not completely right. Fields can be  
configured in mapping to be stored even if by default most of core fields  
have store set to no. When the value of a field is fetched, it can be  
fetched from the stored value in lucene index or extracted from the stored  
\_source (if \_source is enabled which is the default).

For the big text fields you want to index but don't want to retrieve you  
can set "store" to "no" for these fields.

---

<div class="post-metadata">

### Author: ![Jeremie\_BORDIER1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremie_bordier1/32/2860_2.png) [@Jeremie\_BORDIER1](https://discuss.elastic.co/u/Jeremie_BORDIER1)
#### Post date: [November 4, 2011, 4:18pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/4 "2011-11-04T16:18:48Z")

</div>

Hello Benjamin,

What I meant, is that fields are not stored by default 😉 Thanks for  
you precision.

Jérémie

On Fri, Nov 4, 2011 at 5:12 PM, Benjamin Devèze  
[benjamin.deveze@gmail.com](mailto:benjamin.deveze@gmail.com) wrote:

> Hello Andrej,  
> Jérémie I think what you say is not completely right. Fields can be  
> configured in mapping to be stored even if by default most of core fields  
> have store set to no. When the value of a field is fetched, it can be  
> fetched from the stored value in lucene index or extracted from the stored  
> \_source (if \_source is enabled which is the default).  
> For the big text fields you want to index but don't want to retrieve you can  
> set "store" to "no" for these fields.

--  
Jérémie 'ahFeel' BORDIER

---

<div class="post-metadata">

### Author: ![Benjamin\_Deveze](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benjamin_deveze/32/1577_2.png) [@Benjamin\_Deveze](https://discuss.elastic.co/u/Benjamin_Deveze)
#### Post date: [November 4, 2011, 4:32pm UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/5 "2011-11-04T16:32:20Z")

</div>

Hey Jérémie,

no problem. And thanks for the exclude feature by the way 😉

---

<div class="post-metadata">

### Author: ![dean](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@dean](https://discuss.elastic.co/u/dean)
#### Post date: [October 12, 2012, 3:15am UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/6 "2012-10-12T03:15:34Z")

</div>

How can I index fields without storing by using Java API?

---

<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:09am UTC](https://discuss.elastic.co/t/indexing-fields-without-storing/5776/7 "2017-07-06T03:09:09Z")

</div>


