# Optimize storage space with "include\_in\_all": true, "index": "no"

**URL:** <https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500>\
**Category:** Elasticsearch\
**Created:** [October 30, 2012, 2:02pm UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500 "2012-10-30T14:02:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Melentiev](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Max\_Melentiev](https://discuss.elastic.co/u/Max_Melentiev)\
**Post date:** [October 30, 2012, 2:02pm UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/1 "2012-10-30T14:02:30Z")

</div>

As I understood, there is separate index (lucene indexed field) for each  
indexed field in document.

So should be there storage improvement if I implicitly set  
"include\_in\_all": true while  
setting "index": "no" for all fields which I don't want search directly?

Thanks.

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 30, 2012, 3:46pm UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/2 "2012-10-30T15:46:45Z")

</div>

Hello Max,

Yes, you'd save some space if you do that. But please note that you  
would have to explicitly turn on "include\_in\_all" in this case. Take a  
look here:

> <https://gist.github.com/radu-gheorghe/3980928>

It should work as expected: no results when you query "foo", with  
results with "\_all".

But if you omit the "include\_in\_all" part of the mapping, you'd see  
that the \_all query will fail to. At least for me it does on 0.19.11

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Tue, Oct 30, 2012 at 4:02 PM, Max Melentiev [printercu@gmail.com](mailto:printercu@gmail.com) wrote:

> As I understood, there is separate index (lucene indexed field) for each  
> indexed field in document.
> 
> So should be there storage improvement if I implicitly set "include\_in\_all":  
> true while  
> setting "index": "no" for all fields which I don't want search directly?
> 
> Thanks.
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Max\_Melentiev](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Max\_Melentiev](https://discuss.elastic.co/u/Max_Melentiev)\
**Post date:** [October 31, 2012, 2:38am UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/3 "2012-10-31T02:38:22Z")

</div>

Thanks, Radu!

But it seems there is no facility to set up this for all fields in root  
object by default.  
Am I right?

On Tuesday, October 30, 2012 9:46:49 PM UTC+6, Radu Gheorghe wrote:

> Hello Max,
> 
> Yes, you'd save some space if you do that. But please note that you  
> would have to explicitly turn on "include\_in\_all" in this case. Take a  
> look here:  
> [Elasticsearch - include in \_all with index=no · GitHub](https://gist.github.com/3980928)
> 
> It should work as expected: no results when you query "foo", with  
> results with "\_all".
> 
> But if you omit the "include\_in\_all" part of the mapping, you'd see  
> that the \_all query will fail to. At least for me it does on 0.19.11
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Tue, Oct 30, 2012 at 4:02 PM, Max Melentiev \<[prin...@gmail.com](mailto:prin...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> > As I understood, there is separate index (lucene indexed field) for each  
> > indexed field in document.
> > 
> > So should be there storage improvement if I implicitly set  
> > "include\_in\_all":  
> > true while  
> > setting "index": "no" for all fields which I don't want search directly?
> > 
> > Thanks.
> > 
> > --

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [October 31, 2012, 11:48am UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/4 "2012-10-31T11:48:27Z")

</div>

You can define a dynamic template[http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html) that  
would specify settings for all dynamically created fields.

On Tuesday, October 30, 2012 10:38:22 PM UTC-4, Max Melentiev wrote:

> Thanks, Radu!
> 
> But it seems there is no facility to set up this for all fields in root  
> object by default.  
> Am I right?
> 
> On Tuesday, October 30, 2012 9:46:49 PM UTC+6, Radu Gheorghe wrote:
> 
> > Hello Max,
> > 
> > Yes, you'd save some space if you do that. But please note that you  
> > would have to explicitly turn on "include\_in\_all" in this case. Take a  
> > look here:  
> > [Elasticsearch - include in \_all with index=no · GitHub](https://gist.github.com/3980928)
> > 
> > It should work as expected: no results when you query "foo", with  
> > results with "\_all".
> > 
> > But if you omit the "include\_in\_all" part of the mapping, you'd see  
> > that the \_all query will fail to. At least for me it does on 0.19.11
> > 
> > ## Best regards, Radu
> > 
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > 
> > On Tue, Oct 30, 2012 at 4:02 PM, Max Melentiev [prin...@gmail.com](mailto:prin...@gmail.com)  
> > wrote:
> > 
> > > As I understood, there is separate index (lucene indexed field) for  
> > > each  
> > > indexed field in document.
> > > 
> > > So should be there storage improvement if I implicitly set  
> > > "include\_in\_all":  
> > > true while  
> > > setting "index": "no" for all fields which I don't want search  
> > > directly?
> > > 
> > > Thanks.
> > > 
> > > --

--

---

<div class="post-metadata">

**Author:** ![Max\_Melentiev](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Max\_Melentiev](https://discuss.elastic.co/u/Max_Melentiev)\
**Post date:** [November 1, 2012, 4:50am UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/5 "2012-11-01T04:50:52Z")

</div>

Great!, that's it! Thanks Igor!

On Wednesday, October 31, 2012 5:48:27 PM UTC+6, Igor Motov wrote:

> You can define a dynamic template[http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html) that  
> would specify settings for all dynamically created fields.
> 
> On Tuesday, October 30, 2012 10:38:22 PM UTC-4, Max Melentiev wrote:
> 
> > Thanks, Radu!
> > 
> > But it seems there is no facility to set up this for all fields in root  
> > object by default.  
> > Am I right?
> > 
> > On Tuesday, October 30, 2012 9:46:49 PM UTC+6, Radu Gheorghe wrote:
> > 
> > > Hello Max,
> > > 
> > > Yes, you'd save some space if you do that. But please note that you  
> > > would have to explicitly turn on "include\_in\_all" in this case. Take a  
> > > look here:  
> > > [Elasticsearch - include in \_all with index=no · GitHub](https://gist.github.com/3980928)
> > > 
> > > It should work as expected: no results when you query "foo", with  
> > > results with "\_all".
> > > 
> > > But if you omit the "include\_in\_all" part of the mapping, you'd see  
> > > that the \_all query will fail to. At least for me it does on 0.19.11
> > > 
> > > ## Best regards, Radu
> > > 
> > > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > > 
> > > On Tue, Oct 30, 2012 at 4:02 PM, Max Melentiev [prin...@gmail.com](mailto:prin...@gmail.com)  
> > > wrote:
> > > 
> > > > As I understood, there is separate index (lucene indexed field) for  
> > > > each  
> > > > indexed field in document.
> > > > 
> > > > So should be there storage improvement if I implicitly set  
> > > > "include\_in\_all":  
> > > > true while  
> > > > setting "index": "no" for all fields which I don't want search  
> > > > directly?
> > > > 
> > > > 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:06am UTC](https://discuss.elastic.co/t/optimize-storage-space-with-include-in-all-true-index-no/9500/6 "2017-07-06T03:06:37Z")

</div>


