RE: Customize search results in liferay 7.2

Elena Stefanova, modified 5 Years ago. Junior Member Posts: 42 Join Date: 8/24/15 Recent Posts
Hi there!
In my site running on liferay 7.2 CE I need to restrict the type of Search portlet results. I want to show only web content articles of a custom structure. Is  it possible to do so? May be I should use the custom filter widget (https://portal.liferay.dev/docs/7-2/user/-/knowledge_base/u/filtering-search-results-with-the-custom-filter-widget) or I should write a custom app?
Any help is appreciated!
Thanks in advance,
Eli
thumbnail
Mohammed Yasin, modified 5 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Elena Stefanova, modified 5 Years ago. Junior Member Posts: 42 Join Date: 8/24/15 Recent Posts
Hi, Mohammed and thanks for the reply.Yes, I've already checked this option but the problem is that I'm not quite sure how to assign a particular structure type - should I set its ID in some of the conf fields or may be the ddm template key? It's a little confusing for me.
Alexis Greer, modified 5 Years ago. New Member Post: 1 Join Date: 3/5/20 Recent Posts
Mohammed Yasin:

Hi , You can try custom facet 
 https://portal.liferay.dev/docs/7-1/user/-/knowledge_base/u/custom-facet-link
Exactly what I needed! You just saved me several hours. Thanks!
thumbnail
Russell Bohl, modified 5 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts
FYI, here's the 7.2 link: https://portal.liferay.dev/docs/7-2/user/-/knowledge_base/u/custom-facet
I don't think there's much difference in this case, but best to hit the docs for the right version in case something's changed.
thumbnail
Russell Bohl, modified 5 Years ago. Expert Posts: 308 Join Date: 2/13/13 Recent Posts
If you want to filter by structure key, you can use the custom filter as shown in the attached image.
Elena Stefanova, modified 5 Years ago. Junior Member Posts: 42 Join Date: 8/24/15 Recent Posts
Hi, Russell!
Ok, I will give a try. Thanks for the reply!
Gopal Prasad Satapathy, modified 5 Years ago. Junior Member Posts: 51 Join Date: 3/29/18 Recent Posts
Hello,
I am  using  DXP 7.1.
My requirement is to restrict images from showing up in the search result when search is performed only from the default search bar module , but not from any other search available like searching in Document and Media.
Could you please guide me how you created the custom filter? May be it will help me achieve my objective.
​​​​​​​
Thanks in advance.

-Gopal