Commits

Anonymous committed 5a07b04

Comments (0)

Files changed (3)

encuestame-business/src/main/java/org/encuestame/business/service/FrontEndService.java

     }
 
     /**
-     *
+     * Get hashTag relevance.
      * @param hashTagId
      * @param limit
      * @return

encuestame-mvc/src/main/java/org/encuestame/mvc/view/HomeController.java

             final IFrontEndService service = getFrontService();
             try {
                 if (view.isEmpty()) {
-                    model.addAttribute("items", service.searchItemsByTweetPoll(period, 20, request));
+                    model.addAttribute("items", service.searchItemsByTweetPoll(period, 100, request));
                 } else {
                     if ("tweetpoll".equals(view)){
-                        model.addAttribute("items", service.searchItemsByTweetPoll(period, 20, request));
+                        model.addAttribute("items", service.searchItemsByTweetPoll(period, 100, request));
                     } else if("poll".equals(view)){
                         model.addAttribute("items", service.searchItemsByPoll(period, 20));
                     } else if("survey".equals(view)){
-                        model.addAttribute("items", service.searchItemsByTweetPoll(period, 20, request));
+                        model.addAttribute("items", service.searchItemsByTweetPoll(period, 100, request));
                     }
                 }
                 model.addAttribute("hashTags", service.getHashTags(30, 0));

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/HashTagDao.java

     public List<HashTag> getHashTags( final Integer maxResults,
                     final Integer start){
         final DetachedCriteria criteria = DetachedCriteria.forClass(HashTag.class);
+        //criteria.add(Restrictions.gt("hits", 0L));//review
+        criteria.addOrder(Order.desc("hits"));
+        criteria.addOrder(Order.asc("hashTag"));
+        return (List<HashTag>) filterByMaxorStart(criteria, maxResults, start);
+    }
+
+    @SuppressWarnings("unchecked")
+    public List<HashTag> getHashTagsCloud( final Integer maxResults,
+                    final Integer start){
+        final DetachedCriteria criteria = DetachedCriteria.forClass(HashTag.class);
         criteria.add(Restrictions.gt("hits", 0L));//review
         criteria.addOrder(Order.desc("hits"));
         criteria.addOrder(Order.asc("hashTag"));