# Use filter or separate into 2 indices?

**URL:** <https://discuss.elastic.co/t/use-filter-or-separate-into-2-indices/8153>\
**Category:** Elasticsearch\
**Created:** [June 19, 2012, 10:02am UTC](https://discuss.elastic.co/t/use-filter-or-separate-into-2-indices/8153 "2012-06-19T10:02:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ywtsang](https://avatars.discourse-cdn.com/v4/letter/y/a698b9/32.png) [@ywtsang](https://discuss.elastic.co/u/ywtsang)\
**Post date:** [June 19, 2012, 10:02am UTC](https://discuss.elastic.co/t/use-filter-or-separate-into-2-indices/8153/1 "2012-06-19T10:02:19Z")

</div>

Here is a brief description of my index:

doc size: 6100000  
number\_of\_shards: 10,  
number\_of\_replicas: 1

among the docs, i have 2 disjoint sub-types with the following distribution:

type 1: 6000000  
type 2: 100000

For the usage, we must query "type 1" and "type 2" separately, i.e.  
each search result must be either type 1 or type 2.

So we filter on "type" every time we query/search, and it works ok.

But with the above data distribution, I expect most of shards will  
just contain all docs of type 1 and does that mean, on those "type 1  
only" shards, the use of "filter" is wasteful? Will it be better to  
separate into 2 distinct indices so that to avoid the use of "type"  
filter?

Wing

---

<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:23am UTC](https://discuss.elastic.co/t/use-filter-or-separate-into-2-indices/8153/2 "2017-07-06T03:23:26Z")

</div>


