# Is it possible to join/merge two indexes? Merging different indexes of the same kind for general search, but also keeping the single indexes

**URL:** <https://discuss.dgraph.io/t/is-it-possible-to-join-merge-two-indexes-merging-different-indexes-of-the-same-kind-for-general-search-but-also-keeping-the-single-indexes/16346>\
**Category:** Dgraph\
**Tags:** kind:question\
**Created:** [December 16, 2021, 4:20am UTC](https://discuss.dgraph.io/t/is-it-possible-to-join-merge-two-indexes-merging-different-indexes-of-the-same-kind-for-general-search-but-also-keeping-the-single-indexes/16346 "2021-12-16T04:20:53Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Juri](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/juri/32/8872_2.png) [@Juri](https://discuss.dgraph.io/u/Juri)\
**Post date:** [December 18, 2021, 12:07am UTC](https://discuss.dgraph.io/t/is-it-possible-to-join-merge-two-indexes-merging-different-indexes-of-the-same-kind-for-general-search-but-also-keeping-the-single-indexes/16346/7 "2021-12-18T00:07:16Z")

</div>

> [@amaster507](#):
>
> ```auto
> {
> n(func: has(rating), orderdesc: rating, first: 10) @filter(type(Restaurants)) {
> uid
> rating
> # other fields
> }
> }
> 
> ```

E.g I have 1 000 000 hotels in my system, and just 100 restaurants.  
`@filter(type(Restaurants))` would be a bottleneck or not? That would be 1 million internal IF checks that dgraph would do, just to check if a node is a restaurant. or not?

> [@amaster507](#):
>
> illogical to build an index across three types that may no coexist.

i didnt understood that right because of my english - you buddy mean that it is not a good practice to have 3 index’ (one for restaurants one for hotels and one for both)? yea it would a waste of resources, but better performance would be gained or not?

---

_[View the full topic](https://discuss.dgraph.io/t/is-it-possible-to-join-merge-two-indexes-merging-different-indexes-of-the-same-kind-for-general-search-but-also-keeping-the-single-indexes/16346)._
