# How to layout indexes

**URL:** <https://discuss.elastic.co/t/how-to-layout-indexes/9300>\
**Category:** Elasticsearch\
**Created:** [October 10, 2012, 3:26am UTC](https://discuss.elastic.co/t/how-to-layout-indexes/9300 "2012-10-10T03:26:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Douglas\_Ferguson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/douglas_ferguson/32/2121_2.png) [@Douglas\_Ferguson](https://discuss.elastic.co/u/Douglas_Ferguson)\
**Post date:** [October 10, 2012, 3:26am UTC](https://discuss.elastic.co/t/how-to-layout-indexes/9300/1 "2012-10-10T03:26:48Z")

</div>

I've watched a few of the videos and done some reading but I'm still not  
clear on the best way to lay out my indexes.

So, I figured I might present a simple example to see if you guys might  
have some insight.

For example, we have a User object and an Organization object.  
A user may be in multiple Organizations.

I need to be able to search for Organizations using the fields from the  
user object.

One method I see of doing this is to "denormalize" the data where the  
Organization would have an array of users "objects" containing the fields  
you need to search on.  
The problem of course is that you need to index all the Organizations for  
that user whenever the User changes.

I've also seen nested documents and parent/child, but I'm not sure either  
of these actually solves this problem.

Any thoughts?

--

---

<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:** [October 15, 2012, 1:31pm UTC](https://discuss.elastic.co/t/how-to-layout-indexes/9300/2 "2012-10-15T13:31:00Z")

</div>

Hi Douglas,

If you use 0.19.10 you can use has\_parent queries to look in the  
Organization objects, but get results with User objects:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

## Best regards, Radu

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

On Wednesday, October 10, 2012 6:26:48 AM UTC+3, Douglas Ferguson wrote:

> I've watched a few of the videos and done some reading but I'm still not  
> clear on the best way to lay out my indexes.
> 
> So, I figured I might present a simple example to see if you guys might  
> have some insight.
> 
> For example, we have a User object and an Organization object.  
> A user may be in multiple Organizations.
> 
> I need to be able to search for Organizations using the fields from the  
> user object.
> 
> One method I see of doing this is to "denormalize" the data where the  
> Organization would have an array of users "objects" containing the fields  
> you need to search on.  
> The problem of course is that you need to index all the Organizations for  
> that user whenever the User changes.
> 
> I've also seen nested documents and parent/child, but I'm not sure either  
> of these actually solves this problem.
> 
> Any thoughts?

--

---

<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, 3:08am UTC](https://discuss.elastic.co/t/how-to-layout-indexes/9300/3 "2017-07-06T03:08:46Z")

</div>


