# Partitioning of data for each index type

**URL:** <https://discuss.elastic.co/t/partitioning-of-data-for-each-index-type/12113>\
**Category:** Elasticsearch\
**Created:** [May 24, 2013, 2:29pm UTC](https://discuss.elastic.co/t/partitioning-of-data-for-each-index-type/12113 "2013-05-24T14:29:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ymmud](https://avatars.discourse-cdn.com/v4/letter/y/a87d85/32.png) [@ymmud](https://discuss.elastic.co/u/ymmud)\
**Post date:** [May 24, 2013, 2:29pm UTC](https://discuss.elastic.co/t/partitioning-of-data-for-each-index-type/12113/1 "2013-05-24T14:29:13Z")

</div>

Hi All,  
I have a doubt regarding partitioning of data for every index type.

```
In our application the data in elastic search is in sync with DB. Each table in DB maps to an index type in elastic search.
We are now creating monthly partitions for all tables in DB, so that the old partitions can dropped as and when required.

Can we create monthly or weekly partitions for all index types in elastic search and drop the partition when its not required?
If not is there an alternative to achieve the partitioning feature in elastic search.

```

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 29, 2013, 7:22am UTC](https://discuss.elastic.co/t/partitioning-of-data-for-each-index-type/12113/2 "2013-05-29T07:22:04Z")

</div>

Sounds like you want to have multiple indexes, one per month.  
You can do it and have an alias on top of monthly indexes so your front end app will have to query on the alias.

Then, simply remove from the alias the old one and add the new one each month.  
Then, drop the old index.

Does it help?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 24 mai 2013 à 16:29, ymmud [ymmudym@gmail.com](mailto:ymmudym@gmail.com) a écrit :

> Hi All,  
> I have a doubt regarding partitioning of data for every index type.
> 
> In our application the data in Elasticsearch is in sync with DB. Each  
> table in DB maps to an index type in Elasticsearch.  
> We are now creating monthly partitions for all tables in DB, so that the  
> old partitions can dropped as and when required.
> 
> Can we create monthly or weekly partitions for all index types in elastic  
> search and drop the partition when its not required?  
> If not is there an alternative to achieve the partitioning feature in  
> Elasticsearch.
> 
> Thanks in advance,
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Partitioning-of-data-for-each-index-type-tp4035456.html](http://elasticsearch-users.115913.n3.nabble.com/Partitioning-of-data-for-each-index-type-tp4035456.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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:** ![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:34am UTC](https://discuss.elastic.co/t/partitioning-of-data-for-each-index-type/12113/3 "2017-07-06T02:34:12Z")

</div>


