use of org.nextprot.api.solr.AutocompleteSearchResult in project nextprot-api by calipho-sib.
the class SearchController method convert.
private static AutocompleteSearchResult convert(SearchResult searchResult) {
AutocompleteSearchResult autocompleteResult = new AutocompleteSearchResult();
autocompleteResult.setElapsedTime(searchResult.getElapsedTime());
autocompleteResult.setEntity(searchResult.getEntity());
autocompleteResult.setIndex(searchResult.getIndex());
Map<String, List<Map<String, Object>>> facets = searchResult.getFacets();
for (List<Map<String, Object>> value : facets.values()) {
for (Map<String, Object> map : value) {
autocompleteResult.addResult((String) map.get("name"), ((Long) map.get("count")).intValue());
}
}
return autocompleteResult;
}
Aggregations