# One index for each type, or force all documents to fit one type in one index?

**URL:** <https://discuss.elastic.co/t/one-index-for-each-type-or-force-all-documents-to-fit-one-type-in-one-index/94463>\
**Category:** Elasticsearch\
**Created:** [July 25, 2017, 10:42am UTC](https://discuss.elastic.co/t/one-index-for-each-type-or-force-all-documents-to-fit-one-type-in-one-index/94463 "2017-07-25T10:42:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karolinebryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karolinebryn/32/17095_2.png) [@Karolinebryn](https://discuss.elastic.co/u/Karolinebryn)\
**Post date:** [July 25, 2017, 10:42am UTC](https://discuss.elastic.co/t/one-index-for-each-type-or-force-all-documents-to-fit-one-type-in-one-index/94463/1 "2017-07-25T10:42:02Z")

</div>

Hi!

I have an index in ES 1.7 and I am working on moving it to ES 5.x. This index has 8 types with very different mappings. Just a few fields are shared across the different types and some of these have different schema on one type then the other. This is [no longer allowed](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/breaking_20_mapping_changes.html#_conflicting_field_mappings) in ES 2.x (I'm upgrading to 2.x before moving to 5.x), and taking the issue with sparsity into consideration I understand that each index should only have one type (or [several types that has the same mapping](https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping.html)).

In our case we have very little data, with all these types chucked into one index the index only contains ca 6000 documents. Splitting this into one index for each type (8 indexes) will cause some of the indexes to have a few hundred documents, and the largest one will be at around 3000 documents. This seems like it will have an impact on document scoring and cutoff\_frequency. How great will this impact be? Is this still the "best practice" solution?

What about designing a "general type" and have all the different documents fit into this "general type" before indexing them? I understand that there might still be issues with sparsity, but as stated before; we do not have large amounts of data.

I'm hoping that someone has been through this issue and can provide me with some guidence and suggestions as to how they (would have) solved this problem 🙂

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 26, 2017, 8:34pm UTC](https://discuss.elastic.co/t/one-index-for-each-type-or-force-all-documents-to-fit-one-type-in-one-index/94463/2 "2017-07-26T20:34:29Z")

</div>

> [@Karolinebryn](#):
>
> This seems like it will have an impact on document scoring and cutoff\_frequency. How great will this impact be? Is this still the "best practice" solution?

Yes. Depends you need to test. Depends on what you need.  
If you need to be doing the scoring across all of these docs then you need to find a way to normalise them enough to put them into a single index/shard.

---

<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:** [August 23, 2017, 8:34pm UTC](https://discuss.elastic.co/t/one-index-for-each-type-or-force-all-documents-to-fit-one-type-in-one-index/94463/3 "2017-08-23T20:34:30Z")

</div>

Closed on August 23, 2017, 8:34pm UTC

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