Ejemplo n.º 1
0
  @RequestMapping("/search")
  public ModelAndView Search(@RequestParam final String searchtext, HttpSession Session) {

    logger.info(
        "User " + (String) Session.getAttribute("userName") + " searched for " + searchtext);

    final List<TweetData> tweet_list = viewService.searchTweets(searchtext, 0, 10);
    final List<User> user_list = viewService.searchUsers(searchtext, 0, 10);

    return new ModelAndView("search") {
      {
        addObject("searchtext", searchtext);
        addObject("UserList", user_list);
        addObject("TweetList", tweet_list);
        addObject("UserListSize", user_list.size());
        addObject("TweetListSize", tweet_list.size());
      }
    };
  }
Ejemplo n.º 2
0
 @RequestMapping(value = "/search/moreSearchTweets.json", method = RequestMethod.GET)
 @ResponseBody
 public List<TweetData> moreSearchResultsTweets(
     @RequestParam String searchtext, @RequestParam int offset) {
   return viewService.searchTweets(searchtext, offset, 10);
 }