RE: How to show customized result in search result portlet

Amit Sharma, modified 6 Years ago. Junior Member Posts: 35 Join Date: 10/17/18 Recent Posts
Hi ,
I am using search bar to perform the search in my application. Result are getting displayed on Search Result portlet.I want to restrict the search to few select assets only. right now its showing everything even the js and css files from document and media.Same option we got in search portlet to configure the search scope using the configuration menu assets type. here we can set the assets type.
Please help to to configure the restricted search with help of search bar and result portlet.
Thanks-Amit
thumbnail
Mohammed yasin, modified 6 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts
Hi,
  For searching only the restricted asset in search bar , You have add Type Facet Portlet  and configure which all assets have to be searched. 
Amit Sharma, modified 6 Years ago. Junior Member Posts: 35 Join Date: 10/17/18 Recent Posts
Thanks for your Answer this solve the problem
thumbnail
Andrew Jardine, modified 6 Years ago. Liferay Legend Posts: 2416 Join Date: 12/22/10 Recent Posts
Unfortunately I don't think you can mark a document as "no searchable" like you can with Web Content -- something I have never understood to be honest. 
I have in the past had a requirement from clients to allow searching of some files (extensions) but not others and the way we managed that was by adding custom boolean clauses to the search query before it was invoked. In Liferay you can do this with an IndexerPostProcessor. I'm not sure what version of the portal you are on but since you are refrencing the "search bar" I'll assume it's at least 7.1 in which case, maybe this will help: https://portal.liferay.dev/docs/7-1/reference/-/knowledge_base/r/indexer-post-processor