# Post and Comments Mapping

**URL:** <https://discuss.elastic.co/t/post-and-comments-mapping/268007>\
**Category:** Elasticsearch\
**Created:** [March 22, 2021, 7:09pm UTC](https://discuss.elastic.co/t/post-and-comments-mapping/268007 "2021-03-22T19:09:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ignacio\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_fernandez/32/85912_2.png) [@Ignacio\_Fernandez](https://discuss.elastic.co/u/Ignacio_Fernandez)\
**Post date:** [March 22, 2021, 7:09pm UTC](https://discuss.elastic.co/t/post-and-comments-mapping/268007/1 "2021-03-22T19:09:41Z")

</div>

Hello,  
I need to create a mapping for a forum website, where you have Post (with some properties) and each Post can have multiple comment (with more or less same properties).  
For this scenario is it better to have

- Nested Object
- Parent child Documents
- Flat mapping with a field to determine if it is post or comment with the post\_id

Thanks in advance

---

<div class="post-metadata">

**Author:** ![mehdi\_einali](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehdi_einali/32/87260_2.png) [@mehdi\_einali](https://discuss.elastic.co/u/mehdi_einali)\
**Post date:** [April 18, 2021, 11:38am UTC](https://discuss.elastic.co/t/post-and-comments-mapping/268007/2 "2021-04-18T11:38:16Z")

</div>

is there any answer?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 18, 2021, 12:04pm UTC](https://discuss.elastic.co/t/post-and-comments-mapping/268007/3 "2021-04-18T12:04:47Z")

</div>

I'd prefer the later.

---

<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:** [May 16, 2021, 12:05pm UTC](https://discuss.elastic.co/t/post-and-comments-mapping/268007/4 "2021-05-16T12:05:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
