In this section, you first create an indexer for guestbooks. You then modify the service layer to use this indexer to update the search index when a guestbook is persisted:
-
Create a
GuestbookIndexer
class that extends Liferay’sBaseIndexer
abstract class. -
Update
GuestbookLocalServiceImpl
’saddGuestbook
,updateGuestbook
, anddeleteGuestbook
methods to invoke the guestbook indexer.
Since there’s no reason to search for guestbooks in the UI, only the back-end work is necessary.