List of usage examples for com.liferay.portal.kernel.search IndexWriterHelperUtil updateDocuments
public static void updateDocuments(String searchEngineId, long companyId, Collection<Document> documents, boolean commitImmediately) throws SearchException
From source file:com.liferay.knowledgebase.admin.util.KBArticleIndexer.java
License:Open Source License
protected void reindexKBArticles(KBArticle kbArticle) throws Exception { // See KBArticlePermission#contains List<KBArticle> kbArticles = KBArticleLocalServiceUtil.getKBArticleAndAllDescendantKBArticles( kbArticle.getResourcePrimKey(), WorkflowConstants.STATUS_APPROVED, null); Collection<Document> documents = new ArrayList<>(); for (KBArticle curKBArticle : kbArticles) { documents.add(getDocument(curKBArticle)); }//from w w w . j a va2 s . com IndexWriterHelperUtil.updateDocuments(getSearchEngineId(), kbArticle.getCompanyId(), documents, isCommitImmediately()); }