# Elasticsearch join query

**URL:** <https://discuss.elastic.co/t/elasticsearch-join-query/263567>\
**Category:** Elasticsearch\
**Created:** [February 8, 2021, 9:36am UTC](https://discuss.elastic.co/t/elasticsearch-join-query/263567 "2021-02-08T09:36:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diya5](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@diya5](https://discuss.elastic.co/u/diya5)\
**Post date:** [February 8, 2021, 9:36am UTC](https://discuss.elastic.co/t/elasticsearch-join-query/263567/1 "2021-02-08T09:36:11Z")

</div>

I have two indices. One indices "indications" which have some set of values.  
Other is "projects". In this indices i will add indications value like " indication = oncology".  
Now i want to show all indications. Which i can do using terms aggregations. But my issue is that i also want to show count of project in which that indication is used .  
So for that i need to write join query .  
Can anyone help me to resolve issue.  
Result should  
Example:  
[{name:"onclogogy",projectCount:"12"}]

---

<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:** [March 8, 2021, 9:36am UTC](https://discuss.elastic.co/t/elasticsearch-join-query/263567/2 "2021-03-08T09:36:44Z")

</div>

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