public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception {
String field = Util.getParam(params, FIELD_PARAM);
String service = Util.getParam(params, SERVICE_PARAM, "");
int limit = Util.getParam(params, LIMIT_PARAM, DEFAULT_LIMIT);
final SearchRequestParamRepository paramRepository = context.getBean(SearchRequestParamRepository.class);
Specification<SearchRequestParam> specification = SearchRequestParamSpecs.hasTermField(field);
if (!service.equals("")) {
specification = Specifications.where(specification).and(SearchRequestParamSpecs.hasService(service));
}
final List<Pair<String, Integer>> termTextToRequestCount = paramRepository.getTermTextToRequestCount(limit,
specification);
return toElement(termTextToRequestCount);
}