Fórum

How to customized results of liferay default search ?

Harsh Raval, modificado 6 Anos atrás.

How to customized results of liferay default search ?

New Member Postagens: 16 Data de Entrada: 14/03/17 Postagens Recentes
Hello,

I am using Liferay 6.2 EE SP14 for my project.

I want to customize the search results of Liferay default search portlet like I highlighted in below URL image.

I want to remove that part and add DATE and CATEGORY.

https://ibb.co/doLrPQ


Can anyone have any idea about it?

Thanks In Advance.
thumbnail
Andrew Jardine, modificado 6 Anos atrás.

RE: How to customized results of liferay default search ? (Resposta)

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Harsh,

The content that you put in the red box is the result of something called an AssetRenderer. It is possible to define these things are part of your custom entities an I guess, though I have never had to do this, you could use an EXT plugin to alter the core ones. I wouldn't do that though because you won't just affect the search results (asset renderers are used in other places as well)

Customizing search, frankly, is a nightmare. The only way I know how to do it is to use JSP hooks. In your case, for 6.2 you are looking to hook the files that you find until /html/portlet/search -- if you go through these files you'll find the place where the result item is rendered. My guess is that you would have to tear that apart to get what you are looking for.

I have had to do this several times for several clients -- it's not a pleasant task.

NOTE: I feel like it is possible to display date and category out of the box though. If you want to remove the summary text though, that is something you will have to customize through your hooks.
Harsh Raval, modificado 6 Anos atrás.

RE: How to customized results of liferay default search ?

New Member Postagens: 16 Data de Entrada: 14/03/17 Postagens Recentes
Thanks Andrew ,
It is very helpful.. emoticon emoticon
Seema Pavar, modificado 6 Anos atrás.

RE: How to customized results of liferay default search ?

New Member Postagens: 3 Data de Entrada: 28/09/17 Postagens Recentes
thumbnail
Andrew Jardine, modificado 6 Anos atrás.

RE: How to customized results of liferay default search ?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Actually don't follow that link, or that post. Firstly, it doesn't answer his question at all. This is like someone saying what is the best way to eat an apple, and someone else replying "eat an orange". It's also a terrible suggestion that doesn't even apply to all scenarios. For example, consider the case where someone is trying to build an INTRANET site that is not going to be crawled by google.

Also, google has recently announced that it is changing their search api services 00 and I have even heard rumors that it was going to be discontinued entirely. You already have a search. It's in the product, and by using the product YOU have control over what goes into the query, how to organize results, when to reindex, how to provide custom indexers, etc.
Harsh Raval, modificado 6 Anos atrás.

RE: How to customized results of liferay default search ?

New Member Postagens: 16 Data de Entrada: 14/03/17 Postagens Recentes
Thanks for answering Seema, but it is totally different from what I want..!!