# Do Not Index Nested Document

**URL:** <https://discuss.elastic.co/t/do-not-index-nested-document/17938>\
**Category:** Elasticsearch\
**Created:** [June 5, 2014, 8:34pm UTC](https://discuss.elastic.co/t/do-not-index-nested-document/17938 "2014-06-05T20:34:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbehling](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@bbehling](https://discuss.elastic.co/u/bbehling)\
**Post date:** [June 5, 2014, 8:34pm UTC](https://discuss.elastic.co/t/do-not-index-nested-document/17938/1 "2014-06-05T20:34:44Z")

</div>

Hello.

Is it possible to not index a nested document? I know I could add each  
field of the nested document to the mapping file and set index = no, but it  
would be nice if I could specify this at the nested document level. There  
are many fields in my nested doc I would have to type out.

Also, I've been trying the include\_in\_parent = false setting, and I'm not  
sure if this is preventing the nested document from getting indexed.

Thanks

--  
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/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [June 6, 2014, 4:44pm UTC](https://discuss.elastic.co/t/do-not-index-nested-document/17938/2 "2014-06-06T16:44:47Z")

</div>

I use a dynamic template [1] (inside an index template[2]), where the path  
is the nested document.  
"dynamic\_templates": [  
{  
"nested\_doc": {  
"path\_match": "nested.\*",  
"mapping": {  
"index" : "no"  
}  
}  
}  
]

All fields are marked as not indexed unless specifically allowed in the  
mapping.

[1]

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

[2]

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Cheers,

Ivan

On Thu, Jun 5, 2014 at 1:34 PM, Brian Behling [brian.behling@gmail.com](mailto:brian.behling@gmail.com)  
wrote:

> Hello.
> 
> Is it possible to not index a nested document? I know I could add each  
> field of the nested document to the mapping file and set index = no, but  
> it would be nice if I could specify this at the nested document level.  
> There are many fields in my nested doc I would have to type out.
> 
> Also, I've been trying the include\_in\_parent = false setting, and I'm not  
> sure if this is preventing the nested document from getting indexed.
> 
> Thanks
> 
> --  
> 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/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b52e8ff1-9643-4f41-8da7-756be1c68298%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CALY%3DcQC5kwDBq9A%2Bq3BzBd-gwBzT86SmpiGyM210fidB\_tfNiw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC5kwDBq9A%2Bq3BzBd-gwBzT86SmpiGyM210fidB_tfNiw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:24am UTC](https://discuss.elastic.co/t/do-not-index-nested-document/17938/3 "2017-07-06T01:24:09Z")

</div>


