Next up is changing what data is shown on the result page itself. When you do a wildcard search using * you get all kinds of items on the osssearchresults.aspx page. One common ask is to remove container type items like views and folders. On a search center we would either change the web part query template itself or target it using a custom result source to accomplish the filtering.
Using a custom result source is exactly what we’ll do, but the trick is to set this result source to the be default one as osssearchresults.aspx will always use the default result source.
On your site, navigate to site settings and result sources and create a new result source. The following filter will remove all views and container type items from the results.
{searchTerms} -contentclass:STS_List_* iscontainer<>1
So instead of getting
we get
NOTE! The default result source is also used for in-line searching in lists and libraries, so make sure you don’t add a filter to the query which breaks this.