ElasticsearchSearcher { private List<String> getCategories(SearchHit hit) { return toStringList(hit.getFields().get("category")); } ElasticsearchSearcher(Client client); SearchResponse search(String token); List<Result> getResults(SearchResponse response); Faceting getFacets(SearchResponse response); SearchResponse search(String token, Collection<String> filterQueries);  }
@Test public void categoriesAreAvailable() throws IOException { Result result = indexAndSearchSingle("test"); assertEquals(talk.categories.size(), result.getCategories().size()); for (String category: talk.categories) { assertTrue(result.getCategories().contains(category)); } }