# How to create the best index/type for my particular situation

**URL:** <https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463>\
**Category:** Elasticsearch\
**Created:** [July 29, 2015, 7:37am UTC](https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463 "2015-07-29T07:37:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@Erik](https://discuss.elastic.co/u/Erik)\
**Post date:** [July 29, 2015, 7:37am UTC](https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463/1 "2015-07-29T07:37:04Z")

</div>

```
"_index": "crm",
"_type": "employee",
"_id": "1",
"_score": 1,
"_source": {
    "type": null,
    "account": {
        "firstname": null,
        "accountAddress": {
        "street": null,
    }
}

```

I'm currently working on a project using Zend Framework2, Doctrine2 and Elasticsearch, Above is a small piece of a document I'm using.

With Doctrine, I'm fetching the entity change set for processing to elasticsearch but I'm not sure if this is the best way to do it.

Is it better to create more document types ( employee, account, accountaddress) or should I live it the way it is now?

In bigger search forms, I need all the data in the document.

// Erik

---

<div class="post-metadata">

**Author:** ![PatrickKik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrickkik/32/619_2.png) [@PatrickKik](https://discuss.elastic.co/u/PatrickKik)\
**Post date:** [July 29, 2015, 11:28am UTC](https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463/2 "2015-07-29T11:28:13Z")

</div>

One of the best ways to store your data in Elasticsearch is in such a way that it's easy retrievable. Aggregate your data in one document to store, instead of using multiple queries to gather what you need.

---

<div class="post-metadata">

**Author:** ![Erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@Erik](https://discuss.elastic.co/u/Erik)\
**Post date:** [July 29, 2015, 12:52pm UTC](https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463/3 "2015-07-29T12:52:08Z")

</div>

Thought so!  
Thanks for your response.

---

<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 5, 2017, 11:58pm UTC](https://discuss.elastic.co/t/how-to-create-the-best-index-type-for-my-particular-situation/26463/4 "2017-07-05T23:58:22Z")

</div>


