@Override
public SearchResult<Widget> getWidgetsBySearchCriteria(String searchTerm, String widgetType, String widgetStatus,
int offset, int pageSize) {
final WidgetStatus status = StringUtils.isBlank(widgetStatus) ? null : WidgetStatus.get(widgetStatus);
final int count = widgetRepository.getCountByStatusAndTypeAndFreeText(status, widgetType, searchTerm);
final List<Widget> widgets = widgetRepository.getByStatusAndTypeAndFreeTextSearch(status, widgetType,
searchTerm, offset, pageSize);
final SearchResult<Widget> searchResult = new SearchResult<Widget>(widgets, count);
searchResult.setOffset(offset);