4
votes

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

As far as I know, Liferay automatically indexes some out of the box items (core portlets) such as Web Content, Bookmarks, Users etc.

What I need to do is index "public pages" (see screenshot). When I create a new public page with some custom fields, I want to be able to index this in Lucene with Title and Description and be able to search for it as you search other out of the box assets.

enter image description here

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

How can I index them on creation/update so I can search from Lucene? I will appreciate any help with this.

1
I haven't used indexing a lot but I'd search for the portlet that can add new public pages, it should be somewhere under liferay-portal-src-6.1.1-ce-ga2\portal-web\docroot\html\portlet\sites_adminor something. Then use your ext environment to hook it so you can add new entries to your Lucene index.rlegendi

1 Answers

1
votes

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

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

Hope this helps.