Search with string, entry type and category
A more elegant way to handle it would be to use PHP, rely on a more complex routing system with default values, don't rely on segments but on routing parameters. Use real URLs instead of relative paths and build your URLs dynamically instead of just inserting the string hard coded in order to be able to filter by multiple values without loosing the already set filters.

However - to include your parameters all you need to do

{% set searchResults = craft.entries
    .search(searchTerm)
    .section('resources')
    .type(resourceType)
    .orderBy('score') 
    .relatedTo(resourceCat)
%}


I would create a dynamic rule

$event-&gt;rules[] = [
    'pattern'  =&gt; '/resources/&lt;type:\S+&gt;/&lt;category:\S+&gt;/&lt;search:[a-zA-Z0-9-]+&gt;',
    'route'    =&gt; 'module/search/search-elements',
    'defaults' =&gt; [
        'type' =&gt; '',
        'category' =&gt; '',
        'search' =&gt; '',
    ]
];


and search in PHP

public function actionSearchElements(string $type, string $category, string $search)


You can then create a Twig function/filter in order to change those

&lt;a href="/resources/ebooks/{{category.slug}}"&gt;ebooks&lt;/a&gt;


to something like 

&lt;a href="{{ getSearchUrl({category: category.slug}) }}"&gt;ebooks&lt;/a&gt;


And build your URL based on your route params + overwrite the new category. It will make it more re-usable and easier to change in the future if you would like to add an additional parameter or need to change the order you only need to change one place instead of many