# Elasticsearch aggregation query having value as null and non-null

**URL:** <https://discuss.elastic.co/t/elasticsearch-aggregation-query-having-value-as-null-and-non-null/141307>\
**Category:** Elasticsearch\
**Created:** [July 24, 2018, 6:49am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-query-having-value-as-null-and-non-null/141307 "2018-07-24T06:49:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad.ram1431](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@prasad.ram1431](https://discuss.elastic.co/u/prasad.ram1431)\
**Post date:** [July 24, 2018, 6:49am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-query-having-value-as-null-and-non-null/141307/1 "2018-07-24T06:49:09Z")

</div>

Hi All,

I have a requirement like, I need to get the aggregation of the documents having value as null and not-null for a given field. I am able to get individually but together in a single query i don't know. Could someone please help me on this.

Thanks,  
Prasad

---

<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:** [August 21, 2018, 6:49am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-query-having-value-as-null-and-non-null/141307/2 "2018-08-21T06:49:12Z")

</div>

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