RE: Disable Search

thumbnail
Fredi B, modified 5 Years ago. Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Hello Liferay-Community,I am looking for the best solution to disable the search for guests completely.Is the deletion of the Search-Page enough?Remove the permission to search as guest?
Or maybe a completely different approach?
How are you guys disabling the search if you don't want to use it.

Cheers,
Fredi
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
It depends. If it is a convenience feature, you can just remove the page and the portlet in the theme. If guest user actually should not be able to find anything, it becomes trickier.
You will also need to block all API access, e.g. for opensearch to the portal. I believe, the only clean way is to remove the permissions for all relevant content. The one time I needed this, we removed the view permissions for Guest users from all content.
thumbnail
Fredi B, modified 5 Years ago. Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts
Thank you for your answer Christoph,

so I was right, that there is no simple solution for this.
Is there a reason for it?Is there maybe a simple solution for removing Portal-Users completely from search results?
 
Because when searching with * the registered users of the portal show up. 
thumbnail
Christoph Rabel, modified 5 Years ago. Liferay Legend Posts: 1555 Join Date: 9/24/09 Recent Posts
Liferay itself uses search extensively and users are simply indexed. So, they are always available to search and can be found. To make sure that no users are found, it is actually necessary to add a"no users"  term to the query  (or have a whitelist of asset types without users).
When you search: Do you search as an admin or as a guest? Users should not be viewable for guests/other users by default and therefore not found (except by the Administrator, of course). In any case: Permissions are probably the only way to do that in 7.2 (and usually the best/correct way too).
In 6.2 you could simply remove the users class line from the facet configuration. I actually don't know how to configure that for 7.0+, we have never used the builtin search, we have our own search module with a vue.js frontend, typeahead and so on and use that instead. The two main issues for us were that it was a hassle to change the results display (mobile behavior was bad too) and that we had no control over the search parameters (some clients had very specific requirements here).
We probably need to evaluate this strategy for 7.3+ since there templates for search results were introduced. But the usability of our component(typeahead and all) looks still better.