# How to displays missed fields all together including “key” and “doc\_count” with null values in each bucket values with zero (key and doc\_count)

**URL:** <https://discuss.elastic.co/t/how-to-displays-missed-fields-all-together-including-key-and-doc-count-with-null-values-in-each-bucket-values-with-zero-key-and-doc-count/42816>\
**Category:** Elasticsearch\
**Created:** [February 26, 2016, 6:59am UTC](https://discuss.elastic.co/t/how-to-displays-missed-fields-all-together-including-key-and-doc-count-with-null-values-in-each-bucket-values-with-zero-key-and-doc-count/42816 "2016-02-26T06:59:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_S\_N](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@Kiran\_S\_N](https://discuss.elastic.co/u/Kiran_S_N)\
**Post date:** [February 26, 2016, 6:59am UTC](https://discuss.elastic.co/t/how-to-displays-missed-fields-all-together-including-key-and-doc-count-with-null-values-in-each-bucket-values-with-zero-key-and-doc-count/42816/1 "2016-02-26T06:59:08Z")

</div>

This is my query below :

GET article\_info/article/\_search  
{  
"fields": [  
"media\_type"  
],  
"query": {  
"filtered": {  
"query": {  
"query\_string": {  
"query": "pdf\_url:.pdf"  
}  
},  
"filter": {  
"range": {  
"mediadate": {  
"from": "02-21-2016",  
"to": "02-26-2016"  
}  
}  
}  
}  
},  
"size": 0,  
"aggs": {  
"days": {  
"date\_histogram": {  
"field": "mediadate",  
"interval": "day",  
"format": "MM-dd-yyyy",  
"min\_doc\_count": 0  
},  
"aggs": {  
"art\_count": {  
"terms": {  
"field": "media\_type",  
"order": {  
"\_term": "asc"  
}  
}  
}  
}  
}  
}  
}  
}

}

results below here:

{  
"took": 2,  
"timed\_out": false,  
"\_shards": {  
"total": 10,  
"successful": 10,  
"failed": 0  
},  
"hits": {  
"total": 13352,  
"max\_score": 0,  
"hits": []  
},  
"aggregations": {  
"days": {  
"buckets": [  
{  
"key\_as\_string": "02-21-2016",  
"key": 1456012800000,  
"doc\_count": 12496,  
"art\_count": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "blog",  
"doc\_count": 4920  
},  
{  
"key": "media",  
"doc\_count": 36  
},  
{  
"key": "print",  
"doc\_count": 101  
},  
{  
"key": "service",  
"doc\_count": 68  
},  
{  
"key": "social",  
"doc\_count": 36  
},  
{  
"key": "web",  
"doc\_count": 7371  
},  
{  
"key": "wire",  
"doc\_count": 68  
}  
]  
}  
},  
{  
"key\_as\_string": "02-22-2016",  
"key": 1456099200000,  
"doc\_count": 854,  
"art\_count": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "blog",  
"doc\_count": 539  
},  
{  
"key": "service",  
"doc\_count": 92  
},  
{  
"key": "web",  
"doc\_count": 223  
},  
{  
"key": "wire",  
"doc\_count": 92  
}  
]  
}  
},  
{  
"key\_as\_string": "02-23-2016",  
"key": 1456185600000,  
"doc\_count": 1,  
"art\_count": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "web",  
"doc\_count": 1  
}  
]  
}  
},  
{  
"key\_as\_string": "02-24-2016",  
"key": 1456272000000,  
"doc\_count": 1,  
"art\_count": {  
"doc\_count\_error\_upper\_bound": 0,  
"sum\_other\_doc\_count": 0,  
"buckets": [  
{  
"key": "web",  
"doc\_count": 1  
}  
]  
}  
}  
]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Kiran\_S\_N](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@Kiran\_S\_N](https://discuss.elastic.co/u/Kiran_S_N)\
**Post date:** [February 26, 2016, 7:07am UTC](https://discuss.elastic.co/t/how-to-displays-missed-fields-all-together-including-key-and-doc-count-with-null-values-in-each-bucket-values-with-zero-key-and-doc-count/42816/2 "2016-02-26T07:07:32Z")

</div>

please help me as soon.........

---

<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:** [July 5, 2017, 11:09pm UTC](https://discuss.elastic.co/t/how-to-displays-missed-fields-all-together-including-key-and-doc-count-with-null-values-in-each-bucket-values-with-zero-key-and-doc-count/42816/3 "2017-07-05T23:09:35Z")

</div>


