# Filtering on nested fields

**URL:** <https://discuss.elastic.co/t/filtering-on-nested-fields/215758>\
**Category:** Kibana\
**Created:** [January 20, 2020, 2:42pm UTC](https://discuss.elastic.co/t/filtering-on-nested-fields/215758 "2020-01-20T14:42:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgj/32/61059_2.png) [@rgj](https://discuss.elastic.co/u/rgj)\
**Post date:** [January 20, 2020, 2:42pm UTC](https://discuss.elastic.co/t/filtering-on-nested-fields/215758/1 "2020-01-20T14:42:02Z")

</div>

I have a nested field called 'metadata' in my index with various fields inside.  
For some reason filtering in Kibana does not work.  
I have tried various data types but even 'exists' doesn't work correctly.

Things show up in the dashboard nicely:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae1e788dfe831a1a55dfb457d6527c04d93967f8.png)

However, simply trying to filter by a certain value does not work:

 ![OjGyudMnNq](https://us1.discourse-cdn.com/elastic/original/3X/1/0/10a82431350ae6a103f1bc9e3a86e44d08271c12.gif)

What could I be doing wrong?

---

<div class="post-metadata">

**Author:** ![Magnus\_Kessler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_kessler/32/42001_2.png) [@Magnus\_Kessler](https://discuss.elastic.co/u/Magnus_Kessler)\
**Post date:** [January 21, 2020, 7:22am UTC](https://discuss.elastic.co/t/filtering-on-nested-fields/215758/2 "2020-01-21T07:22:02Z")

</div>

How has your nested field been mapped in the index? Is it of type [`object`](https://www.elastic.co/guide/en/elasticsearch/reference/current/object.html) or of type [`nested`](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html)? In the latter case, there is no support in Kibana, yet, for the required [nested queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-nested-query.html) and [nested aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-nested-aggregation.html).

---

<div class="post-metadata">

**Author:** ![rgj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rgj/32/61059_2.png) [@rgj](https://discuss.elastic.co/u/rgj)\
**Post date:** [January 21, 2020, 8:56am UTC](https://discuss.elastic.co/t/filtering-on-nested-fields/215758/3 "2020-01-21T08:56:19Z")

</div>

I just realized that I could get away with using an object (with a bit of more effort) and that makes everything work like a charm.

Thank you!

---

<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:** [February 18, 2020, 8:56am UTC](https://discuss.elastic.co/t/filtering-on-nested-fields/215758/4 "2020-02-18T08:56:36Z")

</div>

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