title: ElasticSearch: Include inner object in search result
body: <p>I've a elastic search index containing elements taht have nested subelements as properties, eg.
  </p>
  
  <pre><code>{
      _index: tests,
      _type: test,
      _id: 11021,
      _version: 1,
      _score: 1,
      _source: {
          id: 11021,
          name: "demotest",
          responsiblePerson: {
              userId: "221",
              userName: "Walter",
              userSurName: "White",
              userEmail: "Walter.White@lospollos.com"
          },      
         listOfSubItems: [{"name": "location"},{"name":"sample"},{"name":"experiment"}]
      }
  }
  </code></pre>
  
  <p>Now, I'd like to include some fields of that explicitly in the result of a query (e.g. to exclude the listOfSubitems from the result to reduce it's size; that's also the reason why i don't want to fall back onto the _source attribute).</p>
  
  <p>The code for the java API would be:</p>
  
  <pre class="lang-java prettyprint-override"><code> SearchResponse responseTests = client.prepareSearch("tests")
                      .addField("id")
                      .addField("name")
                      .addField("responsiblePerson") 
                      .setQuery(QueryBuilders.matchQuery("id", testId))
                      .execute()
                      .actionGet();
  </code></pre>
  
  <p>SearchHits testHits = responseTests.getHits();</p>
  
  <p>Unfortunately, this query doesn't work for some reason as testHits.getTotalHits() shows a number but testHits.getHits().length is <em>0</em> :-(</p>
  
  <p>Does someone have a hint for me how i can get this to work?</p>