title: How to return 0 for requested data in aggregation if no documents matched
body: <p>I have an index of users with structure:</p>
  <pre><code>User
    book_ids:[] //array of book ids 
    books : [{
      book_id:
      name:
    }] //array of books 
  </code></pre>
  <p>I want to create a query that returns a map of Book Id and number of users that read it.
  The result of the query should <strong>include</strong> books that are not used by any user.
  I have a very simplified version of the query:</p>
  <pre><code>{
   &quot;query&quot;:{
      &quot;bool&quot;:{
        &quot;must&quot;:[
          {
            &quot;nested&quot;:{
              &quot;path&quot;:&quot;books&quot;,
              &quot;query&quot;: {
                &quot;bool&quot;: {
                  &quot;must&quot;: {
                    &quot;terms&quot;: {
                      &quot;books.book_id&quot;: [100,200] //book ids that provided as a parameter
                    }
                  }
                }
              }
            }
          }
          ]
      }
    },
    &quot;aggs&quot;:{
      &quot;books&quot;:{
        &quot;terms&quot;:{
          &quot;field&quot;:&quot;book_ids&quot;,
          &quot;include&quot;:[100,200] //book ids that provided as a parameter
        }
      }
    },
    &quot;size&quot;:0
  }
  </code></pre>
  <p>The result of the query will be</p>
  <pre><code>buckets: [
    {key: 100, doc_count: 53}
  ]
  </code></pre>
  <p>So there are 53 users who read the book with id 100, but there is no user who reads book with id 200(as we don't have it in response).
  The question here is how can I change the query to get a following result:</p>
  <pre><code>buckets: [
    {key: 100, doc_count: 53},
    {key: 200, doc_count: 0}
  ]
  </code></pre>