ElasticSearch how display all documents matching date range aggregation
<p>Following elastic docs:
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html</a></p>
<h1>Question:</h1>
<p>How to make date range aggregation and display all documents that match to relevant date bucket just not the <code>doc_count</code>.</p>
<p>The Aggregation  :</p>
<pre><code>{
    &quot;aggs&quot; : {
        &quot;articles_over_time&quot; : {
            &quot;date_histogram&quot; : {
                &quot;field&quot; : &quot;date&quot;,
                &quot;interval&quot; : &quot;1M&quot;,
                &quot;format&quot; : &quot;yyyy-MM-dd&quot; 
            }
        }
    }
}
</code></pre>
<p>Response:</p>
<pre><code>        {
            &quot;aggregations&quot;: {
                &quot;articles_over_time&quot;: {
                    &quot;buckets&quot;: [
                        {
                            &quot;key_as_string&quot;: &quot;2013-02-02&quot;,
                            &quot;key&quot;: 1328140800000,
                            &quot;doc_count&quot;: 1
                        },
                        {
                            &quot;key_as_string&quot;: &quot;2013-03-02&quot;,
                            &quot;key&quot;: 1330646400000,
                            &quot;doc_count&quot;: 2  //how display whole json ??
                 
                    [ .. Here i want to display 
                           all document with array based 
                           NOT only doc_count:2.......... ]

                        },
                        ...
                    ]
                }
            }
        }
</code></pre>
<p>Maybe I need to do some sub-aggregation or something else?</p>
<p>Any ideas?</p>