Please follow the steps given below if you want , Your custom portlets data to be search by Liferay search portlet.
1.Create custom indexer class that extends BaseIndexer.
2.Make custom class indexer entry in liferay-portlet.xml for example,just beneath <icon> tag.
3.Write codes mentioned below in xxxabcLocalServiceImpl class methods ,for example add,delete .
Indexer indexer = IndexerRegistryUtil.getIndexer(xxxabc.class);
for add and update method
indexer.reindex(object of class);
for delete method you should write like
indexer.delete(object of class);
4.Now deploy your portlet and goto Liferay Portal.
5.Add search portlet to page.
6.Click on search portlet configuration.
7.Click on advance button.
8.Add your model name as already entered there, for example BlogsEntry,DLFileEntry.
1.Create custom indexer class that extends BaseIndexer.
2.Make custom class indexer entry in liferay-portlet.xml for example,just beneath <icon> tag.
3.Write codes mentioned below in xxxabcLocalServiceImpl class methods ,for example add,delete .
Indexer indexer = IndexerRegistryUtil.getIndexer(xxxabc.class);
for add and update method
indexer.reindex(object of class);
for delete method you should write like
indexer.delete(object of class);
4.Now deploy your portlet and goto Liferay Portal.
5.Add search portlet to page.
6.Click on search portlet configuration.
7.Click on advance button.
8.Add your model name as already entered there, for example BlogsEntry,DLFileEntry.
No comments:
Post a Comment