0
votes

Has anyone been able to get the liferay url's indexed in solr? (By url I simply mean the liferay page on which portlet/s may be hosted.)

Although the field is defined in the schema, I don't see the values in a solr query response! In fact, the url field is never returned in the response.

Any suggestions? (Our portlet will be hitting the solr server directly to fetch results)

I tried with url as text, indexed=true and stored=true and string, indexed=true and stored=true

2

2 Answers

0
votes

In Liferay pages/urls cosntructed by the Layout object. As far as I know, I dont see the Layout object is being indexed in the first place.

If you want to index the layout object, you may consider writing a hook. At the time of Adding/Updating a layout you can create an index on the layout object.

For example: you can refer to the BookMarks portlet, there you can see how to index bookmarks.

Indexer indexer = IndexerRegistryUtil.getIndexer(
BookmarksEntry.class);
indexer.reindex(entry);

click here

To see how to add custom search capabilities.

0
votes

Pages or Menu structure are not indexed automatically in Liferay.

A simple workaround without Programming:

  • Create a WebContent for each Page that you want to index. Webcontent Name and Content shall contain the page name
  • Make sure that WebContent Display Page is NOT set.
  • Add the WebContent to the page (at the bottom)
  • Change the Color for the WebContent Text to the Background Color (make it invisible) in Look&Feel Menu
  • Make sure that the search portlet is configured to "Display in Context"
  • Search the Page Name aka WebContent Name. Your entry will be on top of the search result. If Not set the Ranking of the WebContent higher...