Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.liferay.portal.kernel.dao.orm.DynamicQuery
- import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil
- import com.liferay.portal.kernel.search.Indexer
- import com.liferay.portal.kernel.search.IndexerRegistryUtil
- import com.liferay.portlet.journal.model.JournalArticle
- import com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil
- Indexer jaIndexer = IndexerRegistryUtil.getIndexer(JournalArticle.class);
- def resKeyArray = []
- def articles = JournalArticleLocalServiceUtil.getArticles()
- articles.each { JournalArticle item ->
- if (!resKeyArray.contains(item.getResourcePrimKey())) {
- resKeyArray.add(item.getResourcePrimKey())
- }
- }
- resKeyArray.each {long key ->
- jaIndexer.reindex(JournalArticle.class.getName(), key);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement