List of usage examples for com.liferay.portal.search.batch BatchIndexingActionable setPerformActionMethod
public <T> void setPerformActionMethod(Consumer<T> consumer);
From source file:com.liferay.docs.guestbook.search.GuestbookEntryBatchReindexerImpl.java
License:Open Source License
@Override public void reindex(long guestbookId, long companyId) { BatchIndexingActionable batchIndexingActionable = indexerWriter.getBatchIndexingActionable(); batchIndexingActionable.setAddCriteriaMethod(dynamicQuery -> { Property guestbookIdPropery = PropertyFactoryUtil.forName("guestbookId"); dynamicQuery.add(guestbookIdPropery.eq(guestbookId)); });/*from w w w .j av a 2s .co m*/ batchIndexingActionable.setCompanyId(companyId); batchIndexingActionable.setPerformActionMethod((GuestbookEntry entry) -> { Document document = indexerDocumentBuilder.getDocument(entry); batchIndexingActionable.addDocuments(document); }); batchIndexingActionable.performActions(); }
From source file:com.liferay.docs.guestbook.search.GuestbookEntryModelIndexerWriterContributor.java
License:Open Source License
@Override public void customize(BatchIndexingActionable batchIndexingActionable, ModelIndexerWriterDocumentHelper modelIndexerWriterDocumentHelper) { batchIndexingActionable.setPerformActionMethod((GuestbookEntry entry) -> { Document document = modelIndexerWriterDocumentHelper.getDocument(entry); batchIndexingActionable.addDocuments(document); });/*ww w. j ava 2 s . com*/ }
From source file:com.liferay.docs.guestbook.search.GuestbookModelIndexerWriterContributor.java
License:Open Source License
@Override public void customize(BatchIndexingActionable batchIndexingActionable, ModelIndexerWriterDocumentHelper modelIndexerWriterDocumentHelper) { batchIndexingActionable.setPerformActionMethod((Guestbook guestbook) -> { Document document = modelIndexerWriterDocumentHelper.getDocument(guestbook); batchIndexingActionable.addDocuments(document); });/*from w ww. j a v a 2 s.c o m*/ }