Example usage for com.liferay.portal.kernel.search SearchResult addComment

List of usage examples for com.liferay.portal.kernel.search SearchResult addComment

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.search SearchResult addComment.

Prototype

public void addComment(Comment comment, Summary summary) 

Source Link

Usage

From source file:com.liferay.message.boards.comment.internal.search.MBMessageCommentSearchResultContributor.java

License:Open Source License

@Override
public void addRelatedModel(SearchResult searchResult, Document document, Locale locale,
        PortletRequest portletRequest, PortletResponse portletResponse) throws PortalException {

    long entryClassPK = GetterUtil.getLong(document.get(Field.ENTRY_CLASS_PK));

    MBMessage mbMessage = _mbMessageLocalService.getMessage(entryClassPK);

    Comment comment = _commentManager.fetchComment(mbMessage.getMessageId());

    Summary summary = new Summary(null, mbMessage.getBody());

    summary.setEscape(false);/*from  www.j ava2  s .  c o  m*/

    searchResult.addComment(comment, summary);
}