# Support for indexing

**URL:** <https://discuss.elastic.co/t/support-for-indexing/10741>\
**Category:** Elasticsearch\
**Created:** [February 14, 2013, 9:59am UTC](https://discuss.elastic.co/t/support-for-indexing/10741 "2013-02-14T09:59:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 14, 2013, 9:59am UTC](https://discuss.elastic.co/t/support-for-indexing/10741/1 "2013-02-14T09:59:54Z")

</div>

Hi chaps,

I'm currently thinking about indexing a Client File. The DB contains  
various things, structured the following way :

- clients owning contracts,
- events occurring on those contracts.

the searches I wish to execute are :

- Find a client, its contracts and the events on this contract
- Find a contract, and its events (an a link to the owner)
- Find an event (and a link to the contract involved).

How should I map this structure ? Should I use nested docs ?

Thanks for your help.

Regards,  
Yann

--  
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:** ![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:** [February 17, 2013, 12:14pm UTC](https://discuss.elastic.co/t/support-for-indexing/10741/2 "2013-02-17T12:14:55Z")

</div>

Hello Yann,

Yes, you can use nested docs, or you can break clients, contracts and  
events into different types and make clients the \_parent of contracts, and  
contracts \_parent of events.

This would let you index and update different documents independently, as  
opposed to nested documents where you have to reindex the whole structured.  
But there are disdvantages on the search side: has\_child query is slower  
than the equivalent nested query, and you'd have to hit ES again to get the  
child.

## Best regards, Radu

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

On Thu, Feb 14, 2013 at 11:59 AM, Yann Barraud [yann.barraud@gmail.com](mailto:yann.barraud@gmail.com)wrote:

> Hi chaps,
> 
> I'm currently thinking about indexing a Client File. The DB contains  
> various things, structured the following way :
> 
> - clients owning contracts,
> - events occurring on those contracts.
> 
> the searches I wish to execute are :
> 
> - Find a client, its contracts and the events on this contract
> - Find a contract, and its events (an a link to the owner)
> - Find an event (and a link to the contract involved).
> 
> How should I map this structure ? Should I use nested docs ?
> 
> Thanks for your help.
> 
> Regards,  
> Yann
> 
> --  
> 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).

--  
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:** ![Yann\_Barraud](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yann_barraud/32/1108_2.png) [@Yann\_Barraud](https://discuss.elastic.co/u/Yann_Barraud)\
**Post date:** [February 18, 2013, 8:34am UTC](https://discuss.elastic.co/t/support-for-indexing/10741/3 "2013-02-18T08:34:27Z")

</div>

Hi Radu,

Thanks for this answer. I'll investigate the 2 options, depending on how we  
want to search items.

Kind regards,  
Yann

Le dimanche 17 février 2013 13:14:55 UTC+1, Radu Gheorghe a écrit :

> Hello Yann,
> 
> Yes, you can use nested docs, or you can break clients, contracts and  
> events into different types and make clients the \_parent of contracts, and  
> contracts \_parent of events.
> 
> This would let you index and update different documents independently, as  
> opposed to nested documents where you have to reindex the whole structured.  
> But there are disdvantages on the search side: has\_child query is slower  
> than the equivalent nested query, and you'd have to hit ES again to get the  
> child.
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> On Thu, Feb 14, 2013 at 11:59 AM, Yann Barraud \<[yann.b...@gmail.com](mailto:yann.b...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi chaps,
> > 
> > I'm currently thinking about indexing a Client File. The DB contains  
> > various things, structured the following way :
> > 
> > - clients owning contracts,
> > - events occurring on those contracts.
> > 
> > the searches I wish to execute are :
> > 
> > - Find a client, its contracts and the events on this contract
> > - Find a contract, and its events (an a link to the owner)
> > - Find an event (and a link to the contract involved).
> > 
> > How should I map this structure ? Should I use nested docs ?
> > 
> > Thanks for your help.
> > 
> > Regards,  
> > Yann
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > 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).  
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:51am UTC](https://discuss.elastic.co/t/support-for-indexing/10741/4 "2017-07-06T02:51:02Z")

</div>


