Search in sources :

Example 1 with Document

use of com.liferay.portal.kernel.search.Document in project liferay-ide by liferay.

the class AlbumIndexer method doReindex.

@Override
protected void doReindex(Object obj) throws Exception {
    Album album = (Album) obj;
    Document document = getDocument(album);
}
Also used : Album(org.liferay.jukebox.model.Album) Document(com.liferay.portal.kernel.search.Document)

Example 2 with Document

use of com.liferay.portal.kernel.search.Document in project liferay-ide by liferay.

the class AlbumIndexer method doGetDocument.

@Override
protected Document doGetDocument(Object obj) throws Exception {
    Album album = (Album) obj;
    Document document = getBaseModelDocument(PORTLET_ID, album);
    document.addDate(Field.MODIFIED_DATE, album.getModifiedDate());
    document.addText(Field.TITLE, album.getName());
    document.addKeyword("year", album.getYear());
    Artist artist = ArtistLocalServiceUtil.getArtist(album.getArtistId());
    document.addText("artist", artist.getName());
    document.addKeyword("artistId", artist.getArtistId());
    return document;
}
Also used : Artist(org.liferay.jukebox.model.Artist) Album(org.liferay.jukebox.model.Album) Document(com.liferay.portal.kernel.search.Document)

Example 3 with Document

use of com.liferay.portal.kernel.search.Document in project liferay-ide by liferay.

the class ArtistIndexer method reindexEntries.

protected void reindexEntries(long companyId) throws PortalException, SystemException {
    final Collection<Document> documents = new ArrayList<Document>();
    ActionableDynamicQuery actionableDynamicQuery = new ArtistActionableDynamicQuery() {

        @Override
        protected void addCriteria(DynamicQuery dynamicQuery) {
        }

        @Override
        protected void performAction(Object object) throws PortalException {
            Artist artist = (Artist) object;
            Document document = getDocument(artist);
            documents.add(document);
        }
    };
    actionableDynamicQuery.setCompanyId(companyId);
    actionableDynamicQuery.performActions();
    SearchEngineUtil.updateDocuments(getSearchEngineId(), companyId, documents);
}
Also used : Artist(org.liferay.jukebox.model.Artist) DynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) ArtistActionableDynamicQuery(org.liferay.jukebox.service.persistence.ArtistActionableDynamicQuery) ArrayList(java.util.ArrayList) ArtistActionableDynamicQuery(org.liferay.jukebox.service.persistence.ArtistActionableDynamicQuery) Document(com.liferay.portal.kernel.search.Document) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) ArtistActionableDynamicQuery(org.liferay.jukebox.service.persistence.ArtistActionableDynamicQuery)

Example 4 with Document

use of com.liferay.portal.kernel.search.Document in project liferay-ide by liferay.

the class ArtistIndexer method doReindex.

@Override
protected void doReindex(Object obj) throws Exception {
    Artist artist = (Artist) obj;
    Document document = getDocument(artist);
    SearchEngineUtil.updateDocument(getSearchEngineId(), artist.getCompanyId(), document);
}
Also used : Artist(org.liferay.jukebox.model.Artist) Document(com.liferay.portal.kernel.search.Document)

Example 5 with Document

use of com.liferay.portal.kernel.search.Document in project liferay-ide by liferay.

the class SongIndexer method doReindex.

@Override
protected void doReindex(Object obj) throws Exception {
    Song song = (Song) obj;
    Document document = getDocument(song);
    SearchEngineUtil.updateDocument(getSearchEngineId(), song.getCompanyId(), document);
}
Also used : Song(org.liferay.jukebox.model.Song) Document(com.liferay.portal.kernel.search.Document)

Aggregations

Document (com.liferay.portal.kernel.search.Document)13 ArrayList (java.util.ArrayList)5 Artist (org.liferay.jukebox.model.Artist)5 ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)4 KBArticle (com.liferay.knowledgebase.model.KBArticle)3 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)3 Album (org.liferay.jukebox.model.Album)3 Song (org.liferay.jukebox.model.Song)3 KBArticleActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery)1 Property (com.liferay.portal.kernel.dao.orm.Property)1 FileEntry (com.liferay.portal.kernel.repository.model.FileEntry)1 SearchResult (com.liferay.portal.kernel.search.SearchResult)1 Summary (com.liferay.portal.kernel.search.Summary)1 DLFileEntry (com.liferay.portlet.documentlibrary.model.DLFileEntry)1 JournalArticle (com.liferay.portlet.journal.model.JournalArticle)1 MBMessage (com.liferay.portlet.messageboards.model.MBMessage)1 ArtistActionableDynamicQuery (org.liferay.jukebox.service.persistence.ArtistActionableDynamicQuery)1 SongActionableDynamicQuery (org.liferay.jukebox.service.persistence.SongActionableDynamicQuery)1