0

I have a requirement with Liferay 7.1. I need to create a search page where the user can see the result organized into columns by some categories. I've been thinking two approaches:

  1. Create some logic in the theme to completely change the search page and organize the data
  2. Create a module that uses the same search service that Liferay actually uses.

I rather chose the second approach because I don't want to mess with the DOM and I think it's easier to make my own page, but I haven't been able to find that service, could anyone give me some information about that search service I need to use?

I tried to use this one as a guide: https://github.com/liferay/com-liferay-portal-search/blob/master/portal-search-web/src/main/java/com/liferay/portal/search/web/internal/portlet/SearchPortlet.java; but I couldn't create a PortalOpenSearchImpl instance.

Andrés Sanz
  • 55
  • 2
  • 6
  • Does this answer help: https://stackoverflow.com/questions/57622523/customize-search-results-in-liferay-7-2/57630502#57630502 ? – Milen Dyankov Sep 12 '19 at 12:01
  • Possible duplicate of [Customize search results in Liferay 7.2](https://stackoverflow.com/questions/57622523/customize-search-results-in-liferay-7-2) – Milen Dyankov Sep 12 '19 at 12:02
  • Although the question is similar, I'm stuck in the same problem. One of the suggestion is to create my own result search portlet, but I don't know where to start with that approach because I can't find examples online, I'll keep looking into that Github, thanks – Andrés Sanz Sep 12 '19 at 13:48
  • @AndrésSanz BE SURE to walk that road .. I would check If grouping or facets would help .. – André Sep 12 '19 at 18:29

1 Answers1

0

First of all, see the options mentioned in this answer. Perhaps you can simply assemble the page from existing widgets and just customize the look and feel.

If that is not an option then you need to create custom portlet. From your question I understand you are going down that road, but you are looking at the wrong code. The link you pasted is from the time Liferay used separate repos for modules. However it's now back to monorepo. Here is the code of the Search Portlet of version 7.1

It is not possible to explain here how the whole search infrastructure in the portal works. Have a look at the content of the portal-search folder to get an idea of the complexity of that functionality. All I can do is give you some links to the relevant sections of the documentation:

as well as links to same (perhaps relevant) samples:

Milen Dyankov
  • 2,972
  • 14
  • 25