assertThat(searchResponse.getHits().hits()[2].id(), equalTo("1"));
assertThat(searchResponse.getHits().hits()[2].sortValues()[0].toString(), equalTo("4"));
searchResponse = client().prepareSearch("test")
.setTypes("type1")
.setQuery(QueryBuilders.matchAllQuery())
<BUG>.addSort(SortBuilders.fieldSort("nested1.field1").order(SortOrder.DESC))
</BUG>
.execute().actionGet();
assertHitCount(searchResponse, 3);
assertThat(searchResponse.getHits().hits()[0].id(), equalTo("1"));

assertThat(searchResponse.getHits().hits()[2].id(), equalTo("1"));
assertThat(searchResponse.getHits().hits()[2].sortValues()[0].toString(), equalTo("4"));
searchResponse = client().prepareSearch("test")
.setTypes("type1")
.setQuery(QueryBuilders.matchAllQuery())
.addSort(SortBuilders.fieldSort("nested1.field1").order(SortOrder.DESC).setNestedPath("nested1"))
.execute().actionGet();
assertHitCount(searchResponse, 3);
assertThat(searchResponse.getHits().hits()[0].id(), equalTo("1"));
