boolQuery().must(termQuery("nested1.n_field1", "n_value1_1")).must(termQuery("nested1.n_field2", "n_value2_1")))).execute().actionGet();
assertThat(Arrays.toString(searchResponse.shardFailures()), searchResponse.failedShards(), equalTo(0));
assertThat(searchResponse.hits().totalHits(), equalTo(1l));
// check delete, so all is gone...
DeleteResponse deleteResponse = client.prepareDelete("test", "type1", "2").execute().actionGet();
assertThat(deleteResponse.notFound(), equalTo(false));
// flush, so we fetch it from the index (as see that we filter nested docs)
client.admin().indices().prepareFlush().setRefresh(true).execute().actionGet();
statusResponse = client.admin().indices().prepareStatus().execute().actionGet();