Message Boards

How to remove images from Liferay Search Results?

thumbnail
Anuvab Ghosh, modified 3 Years ago.

How to remove images from Liferay Search Results?

Regular Member Posts: 130 Join Date: 4/18/15 Recent Posts
Hi,
I am using Liferay 7.2, DXP & CE both. Usually we keep files (extensions are pdf, doc, jpg, png) in Document and Media.
​​​​​​​In search, getting all these as results if it is matched with the keyword.
Only I have to show pdf, doc but do not need to show the images(extension: jpg, png,etc.) in Liferay Search Results.

How can I achieve this?
Kindly guide me  and provide suggestions regarding this.
Thanks in advance.
Regards,
Anuvab
Gopal Prasad Satapathy, modified 3 Years ago.

RE: How to remove images from Liferay Search Results?

Junior Member Posts: 51 Join Date: 3/29/18 Recent Posts

Hi,

Did you find any solution for this?

 

Thanks,

Gopal

thumbnail
Russell Bohl, modified 3 Years ago.

RE: How to remove images from Liferay Search Results?

Expert Posts: 291 Join Date: 2/13/13 Recent Posts

I would likely attack this with the Custom Filter widget:

See Filtering Search Results

 

You could add a tag ("nosearch" maybe) to all the docs and media files you don't want to search, then use a Must Not match type in the custom filter widget to eclude them, for one approach.

 

You might a lso be able to target specific extensions with the custom filter widget, but I can't think off the top of my head how, exactly.

 

Edited to add: In 7.3 I did this by adding a Must_Not Match Query filter for "jpg" on the "extension" field: