[TEST] non stored fields are not returned anymore via fields

Relates to https://github.com/elastic/elasticsearch/issues/14489

Original commit: elastic/x-pack-elasticsearch@2897dc5df7
This commit is contained in:
javanna 2015-11-30 12:12:31 +01:00 committed by Luca Cavanna
parent 7277d280ca
commit 171179d91f
1 changed files with 2 additions and 3 deletions

View File

@ -42,10 +42,9 @@ public class IndexAuditIT extends ESIntegTestCase {
assertThat(found, is(true));
SearchResponse searchResponse = client().prepareSearch(".shield_audit_log*").setQuery(QueryBuilders.matchQuery("principal", USER)).addField("principal").get();
SearchResponse searchResponse = client().prepareSearch(".shield_audit_log*").setQuery(QueryBuilders.matchQuery("principal", USER)).get();
assertThat(searchResponse.getHits().getHits().length, greaterThan(0));
assertThat((String) searchResponse.getHits().getAt(0).field("principal").getValue(), is(USER));
assertThat((String) searchResponse.getHits().getAt(0).sourceAsMap().get("principal"), is(USER));
}
@Override