@RequestParam(value = "_scheduled", required = false) Boolean isScheduled,
@RequestParam(value = "period", required = false) String period,
HttpServletRequest request, HttpServletResponse response)
throws JsonGenerationException, JsonMappingException, IOException {
final Map<String, Object> jsonResponse = new HashMap<String, Object>();
final PollSearchBean tpollSearchBean = new PollSearchBean();
try {
// Create TweetpollSearchBean
tpollSearchBean.setIsComplete(isCompleted == null ? false : isCompleted);
tpollSearchBean.setIsFavourite(isFavourite == null ? false : isFavourite);
tpollSearchBean.setIsPublished(isPublished == null ? false : isPublished);
tpollSearchBean.setIsScheduled(isScheduled == null ? false : isScheduled);
tpollSearchBean.setKeyword(keyword == null ? null : keyword.isEmpty() ? null : keyword);
tpollSearchBean.setMax(max);
//tpollSearchBean.setPeriod(period); it's not used, will be removed in the future.
tpollSearchBean.setSearchResult(null);
tpollSearchBean.setStart(start);
tpollSearchBean.setTypeSearch(TypeSearch.getSearchString(typeSearch));
tpollSearchBean.setProviders(socialNetworks == null ? ListUtils.EMPTY_LIST : ConvertDomainBean.convertSocialProviderStringToProvider(socialNetworks));
tpollSearchBean.setSocialAccounts(socialAccountNetworks == null ? ListUtils.EMPTY_LIST : socialAccountNetworks);
final List<SearchBean> list = (List<SearchBean>) getPollService().filterSearchPollsByType(
tpollSearchBean, request);
//log.debug("/api/survey/poll/search.json----------------> "+ list.size());
jsonResponse.put("poll", list);
setItemResponse(jsonResponse);