# Schema advice

**URL:** <https://discuss.elastic.co/t/schema-advice/12667>\
**Category:** Elasticsearch\
**Created:** [July 4, 2013, 4:21pm UTC](https://discuss.elastic.co/t/schema-advice/12667 "2013-07-04T16:21:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gergely\_Nemeth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gergely_nemeth/32/2240_2.png) [@Gergely\_Nemeth](https://discuss.elastic.co/u/Gergely_Nemeth)\
**Post date:** [July 4, 2013, 4:21pm UTC](https://discuss.elastic.co/t/schema-advice/12667/1 "2013-07-04T16:21:22Z")

</div>

Hey,

i have the following scenario: i have posts and comments for the posts, and  
i want to search sometimes only in the posts, sometimes only in the  
comments, sometimes i would like to have an aggregated search ( for example  
search for 'elastic' in comments and posts at the same time ).

What kind of Schemas should I use? Should the comments be nested inside the  
posts ? Should they be entirely different type?

Thanks in advance!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Maarten\_Roosendaal](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Maarten\_Roosendaal](https://discuss.elastic.co/u/Maarten_Roosendaal)\
**Post date:** [July 5, 2013, 9:56am UTC](https://discuss.elastic.co/t/schema-advice/12667/2 "2013-07-05T09:56:10Z")

</div>

Hi,

See  
[Fun with elasticsearch's children and nested documents - Space Vatican](http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/) for  
some tips.

Have the same issue, however the examples from the website (parent/child)  
don't work (but i'm probably doing something wrong.

Cheers,  
Maarten

Op donderdag 4 juli 2013 18:21:22 UTC+2 schreef Gergely Németh het volgende:

> Hey,
> 
> i have the following scenario: i have posts and comments for the posts,  
> and i want to search sometimes only in the posts, sometimes only in the  
> comments, sometimes i would like to have an aggregated search ( for example  
> search for 'elastic' in comments and posts at the same time ).
> 
> What kind of Schemas should I use? Should the comments be nested inside  
> the posts ? Should they be entirely different type?
> 
> Thanks in advance!

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:28am UTC](https://discuss.elastic.co/t/schema-advice/12667/3 "2017-07-06T02:28:04Z")

</div>

Closed on July 6, 2017, 2:28am UTC


