try {
ProductSearchResult result = null;
result = getSearchService().findProductsByQuery(q, searchCriteria);
facetService.setActiveFacetResults(result.getFacets(), request);
SearchResultsWrapper wrapper = (SearchResultsWrapper) context.getBean(SearchResultsWrapper.class.getName());
wrapper.wrapDetails(result, request);
return wrapper;
} catch (ServiceException e) {
throw BroadleafWebServicesException.build(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
.addMessage(BroadleafWebServicesException.SEARCH_ERROR);