Package org.encuestame.core.search

Examples of org.encuestame.core.search.GlobalSearchItem


     * @param profile
     * @return
     */
    public static GlobalSearchItem convertProfileToSearchItem(
            final UserAccount profile) {
        final GlobalSearchItem globalSearchItem = new GlobalSearchItem();
        globalSearchItem.setUrlLocation("/profile/" + profile.getUsername());
        globalSearchItem.setHits(0L);
        globalSearchItem.setId(profile.getUid());
        globalSearchItem.setItemSearchTitle(profile.getCompleteName());
        globalSearchItem.setTypeSearchResult(TypeSearchResult.PROFILE);
        globalSearchItem.setScore(100L); //FIXME: fixed number?
        return globalSearchItem;
    }
View Full Code Here


     * @param comment
     * @return
     */
  public static GlobalSearchItem convertCommentToSearchItem(
      final Comment comment) {
    final GlobalSearchItem globalSearchItem = new GlobalSearchItem();
    globalSearchItem.setDateCreated(comment.getCreatedAt());
    globalSearchItem.setId(comment.getCommentId());
    globalSearchItem.setTypeSearchResult(TypeSearchResult.COMMENT);
    globalSearchItem.setScore(100l);
    globalSearchItem.setItemSearchTitle(comment.getComment());
    return globalSearchItem;
  }
View Full Code Here

     * @param question
     * @return
     */
    public static GlobalSearchItem convertQuestionToSearchItem(
            final Question question) {
        final GlobalSearchItem globalSearchItem = new GlobalSearchItem();
        globalSearchItem.setUrlLocation("/question/detail/" + question.getQid() + "/" + RestFullUtil.slugify(question.getQuestion()));
        globalSearchItem.setHits(question.getHits());
        globalSearchItem.setId(question.getQid());
        globalSearchItem.setItemSearchTitle(question.getQuestion());
        globalSearchItem.setDateCreated(question.getCreateDate());
        globalSearchItem.setItemPattern(question.getQuestionPattern().name());
        globalSearchItem.setTypeSearchResult(TypeSearchResult.QUESTION);
        globalSearchItem.setScore(100L); //FIXME: fixed number?
        return globalSearchItem;
    }
View Full Code Here

     * @param item
     * @return
     */
    public static GlobalSearchItem convertAttachmentSearchToSearchItem(
            final AttachmentSearchItem item) {
        final GlobalSearchItem globalSearchItem = new GlobalSearchItem();
        globalSearchItem
                .setUrlLocation("/resource/detail/" + item.getAttachId()+"/"+RestFullUtil.slugify(item.getDescription()));
        globalSearchItem.setHits(200L); //FIXME: fixed number?
        globalSearchItem.setId(item.getAttachId());
        globalSearchItem.setItemSearchTitle(item.getDescription());
        globalSearchItem.setTypeSearchResult(TypeSearchResult.ATTACHMENT);
        globalSearchItem.setScore(100L); //FIXME: fixed number?
        return globalSearchItem;
    }
View Full Code Here

     *
     * @param tag
     * @return
     */
    public static GlobalSearchItem convertHashTagToSearchItem(final HashTag tag) {
        final GlobalSearchItem globalSearchItem = new GlobalSearchItem();
        globalSearchItem.setUrlLocation("/tag/"
                + RestFullUtil.formatHasgTag(tag.getHashTag()));
        globalSearchItem.setHits(tag.getHits());
        globalSearchItem.setId(tag.getHashTagId());
        globalSearchItem.setItemSearchTitle(tag.getHashTag());
        globalSearchItem.setTypeSearchResult(TypeSearchResult.HASHTAG);
        globalSearchItem.setScore(100L); //FIXME: fixed number?
        return globalSearchItem;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.core.search.GlobalSearchItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.