How to index and search for "Public Pages" in Liferay 6?

I am new to life, so please bear with me if this is a naive question.

As far as I know, Liferay automatically indexes some of the window elements (main portlets), such as web content, bookmarks, users, etc.

What I need to do is index the β€œpublic pages” (see screenshot). When I create a new public page with some custom fields, I want to be able to index it in Lucene with a title and description and be able to search for it when looking for other assets out of the box.

enter image description here

I understand that you can write an indexer for a custom portlet, but Public Pages is something completely different.

How can I index them when creating / updating so that I can search from Lucene? I would appreciate any help with this.

+4
source share
1 answer

Liferay pages are nothing but a Liferay Layout object. Do it

  • Create a Liferay Hook plugin and override LayoutLocalService .
  • Modify the addLayout method and with the appropriate condition (specify the public page)
  • Call the SearchEngineUtil class and call the addDocument method to save the data to the index.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/1500493/


All Articles