# Query Two Subtypes in the same index

**URL:** <https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613>\
**Category:** Kibana\
**Created:** [March 12, 2018, 6:28pm UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613 "2018-03-12T18:28:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)\
**Post date:** [March 12, 2018, 6:28pm UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/1 "2018-03-12T18:28:28Z")

</div>

Hello : Had a question around how to search against TWO subtypes in the same index?  
This is my index setup:  
myindex/calldata  
myindex/customerdata

a call data has a field called message which looks like this : `{ callerid : abcd, file=123}`  
customerdata looks like thjis : `{customerid : aabbcc, file=123}`

There is a common field **file** as shown above to both types calldata and customerdata  
I would like to do a search like this:  
"Get me all calldata and customerdata where calldata has some callerid ABCD1234"

How would I do this?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [March 12, 2018, 6:51pm UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/2 "2018-03-12T18:51:40Z")

</div>

@titan1978 are you attempting to search using Discover, or create a Visualization against that field? Also which version of Kibana are you using?

---

<div class="post-metadata">

**Author:** ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)\
**Post date:** [March 12, 2018, 9:43pm UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/3 "2018-03-12T21:43:36Z")

</div>

using discover and 5.5

---

<div class="post-metadata">

**Author:** ![titan1978](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@titan1978](https://discuss.elastic.co/u/titan1978)\
**Post date:** [March 12, 2018, 9:44pm UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/4 "2018-03-12T21:44:37Z")

</div>

@Brandon_Kobel Using Discovery and 5.5 . Any suggestions would help even how would I do this using Visualizations?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [March 13, 2018, 11:47am UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/5 "2018-03-13T11:47:25Z")

</div>

@titan1978 in 5.5 you should be able to use Visualize and Discover seamlessly across types that share a common field. If you go to Management -\> Index Patterns and select your Index Pattern, do you see the file field listed? What happens when you try to Search/Visualize against this common field?

---

<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:** [April 10, 2018, 11:47am UTC](https://discuss.elastic.co/t/query-two-subtypes-in-the-same-index/123613/6 "2018-04-10T11:47:46Z")

</div>

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