public CountedContainer<Prediction> search(SecurityContext sec, String query, int resultSize) {
   securityCheck(sec, Roles.SEARCH);
   SearchResults results = searchService.search(query, resultSize);
   if (results.predictions.isEmpty()) {
     return CountedContainer.wrap(Collections.emptyList(), results.hits, resultSize);
   }
   List<Prediction> list = InputSanitizer.desanitize(db.getPredictions(results.predictions));
   return CountedContainer.wrap(list, results.hits, resultSize);
 }
 public Object suggest(SecurityContext sec, String term, int top) {
   securityCheck(sec, Roles.SEARCH);
   return searchService.suggest(term, top);
 }
 public Map<String, FacetedSearchResults> aggregateByCreateDate(
     SecurityContext sec, Integer days, String field) {
   securityCheck(sec, Roles.SEARCH);
   return searchService.getCountsForLastNDays(days, field);
 }
 public FacetedSearchResults aggregateBySource(SecurityContext sec) throws IOException {
   securityCheck(sec, Roles.SEARCH);
   return searchService.aggregateBySource();
 }
 public List<WordsWithFreq> getTopTagsForField(SecurityContext sec, int top, Schema field) {
   securityCheck(sec, Roles.SEARCH);
   return searchService.getTopTags(top, field);
 }