# Autogeneration of the schema from the data. Plus I know that one field is a parent/child relationship. How to deal with that?

**URL:** <https://discuss.elastic.co/t/autogeneration-of-the-schema-from-the-data-plus-i-know-that-one-field-is-a-parent-child-relationship-how-to-deal-with-that/15387>\
**Category:** Elasticsearch\
**Created:** [January 23, 2014, 9:55pm UTC](https://discuss.elastic.co/t/autogeneration-of-the-schema-from-the-data-plus-i-know-that-one-field-is-a-parent-child-relationship-how-to-deal-with-that/15387 "2014-01-23T21:55:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Rossel](https://avatars.discourse-cdn.com/v4/letter/o/ea666f/32.png) [@Olivier\_Rossel](https://discuss.elastic.co/u/Olivier_Rossel)\
**Post date:** [January 23, 2014, 9:55pm UTC](https://discuss.elastic.co/t/autogeneration-of-the-schema-from-the-data-plus-i-know-that-one-field-is-a-parent-child-relationship-how-to-deal-with-that/15387/1 "2014-01-23T21:55:00Z")

</div>

I mostly use the schemaless features of ElasticSearch.  
But sometimes, I have a field that is typed as a String whereas it is in  
fact the parent field of a parent/child relationship.

What is the best strategy to define those parent fields AND still use the  
autogeneration of the schema by Elasticsearch?

--  
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/8a49e560-ce4b-4e8b-a2ed-ca610a25b92a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8a49e560-ce4b-4e8b-a2ed-ca610a25b92a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [January 24, 2014, 11:12pm UTC](https://discuss.elastic.co/t/autogeneration-of-the-schema-from-the-data-plus-i-know-that-one-field-is-a-parent-child-relationship-how-to-deal-with-that/15387/2 "2014-01-24T23:12:56Z")

</div>

Can you establish a naming convention for the parent fields? You can  
probably use index templates:

> **[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.

--  
Ivan

On Thu, Jan 23, 2014 at 1:55 PM, Olivier Rossel [olivier.rossel@gmail.com](mailto:olivier.rossel@gmail.com)wrote:

> I mostly use the schemaless features of Elasticsearch.  
> But sometimes, I have a field that is typed as a String whereas it is in  
> fact the parent field of a parent/child relationship.
> 
> What is the best strategy to define those parent fields AND still use the  
> autogeneration of the schema by Elasticsearch?
> 
> --  
> 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/8a49e560-ce4b-4e8b-a2ed-ca610a25b92a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8a49e560-ce4b-4e8b-a2ed-ca610a25b92a%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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%3DcQCgrmQKmjHkjTyYnUySdKd4j7Y%3DZYQ9%3DKyvy\_mBnsqVoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCgrmQKmjHkjTyYnUySdKd4j7Y%3DZYQ9%3DKyvy_mBnsqVoQ%40mail.gmail.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, 1:54am UTC](https://discuss.elastic.co/t/autogeneration-of-the-schema-from-the-data-plus-i-know-that-one-field-is-a-parent-child-relationship-how-to-deal-with-that/15387/3 "2017-07-06T01:54:52Z")

</div>


