# Using elasticsearch as framework for other index

**URL:** <https://discuss.elastic.co/t/using-elasticsearch-as-framework-for-other-index/5320>\
**Category:** Elasticsearch\
**Created:** [September 7, 2011, 6:54am UTC](https://discuss.elastic.co/t/using-elasticsearch-as-framework-for-other-index/5320 "2011-09-07T06:54:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anahap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anahap/32/1503_2.png) [@anahap](https://discuss.elastic.co/u/anahap)\
**Post date:** [September 7, 2011, 6:54am UTC](https://discuss.elastic.co/t/using-elasticsearch-as-framework-for-other-index/5320/1 "2011-09-07T06:54:57Z")

</div>

Hi Shay,

I have a specialized index for binary data (non lucene) which has a  
requirement of having at most 500k documents in it, so if there are  
more to be indexed i have to creat a new shard.

i was wondering if it is possible to use elasticsearch in this case to  
query and index the custom index(s), so that i dont have to program  
the sharding and search process, as elasticsearch does this very well.

Are there points in the source code of es where I can jump in to try  
this? or is the network and sharding code too  
entrenched with the lucene library.

TIA  
Andy

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [September 7, 2011, 12:37pm UTC](https://discuss.elastic.co/t/using-elasticsearch-as-framework-for-other-index/5320/2 "2011-09-07T12:37:20Z")

</div>

Hi Andy

> I have a specialized index for binary data (non lucene) which has a  
> requirement of having at most 500k documents in it, so if there are  
> more to be indexed i have to creat a new shard.
> 
> i was wondering if it is possible to use elasticsearch in this case to  
> query and index the custom index(s), so that i dont have to program  
> the sharding and search process, as elasticsearch does this very well.

You can't add primary shards to an existing index, as ES uses the number  
of shards to calculate where each ID will be stored.

However, an easy solution is to use aliases:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

You could just create an alias "binary" and point it to the first real  
index (which has a single shard) called "binary\_1". When you need to  
create more shards, you create a new index "binary\_2" and update the  
"binary" alias to point to both of them.

That way you can query all your indices as a single "index" while  
controlling the number of shards dynamically.

clint

---

<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:55am UTC](https://discuss.elastic.co/t/using-elasticsearch-as-framework-for-other-index/5320/3 "2017-07-06T03:55:05Z")

</div>


