It is possible to filter out the products from specific categories from the the search results. You'll need to add some Liquid logic at the Search Results block.

At the Search Results Block you find something like:

<article>
<h1 class="title-product">{{product.name}}</h1>
<h2 class="description-product">{{product.description}}</h2>
</article>
{% endfor %}

before paginating the results with {% paginate search.results by 8 %} add:


{% assign filtered_cats = "category-permalink-1|cat-perm-2|cat-perm-3" | split: "|" %}

to select the categories to filter out from the search results. And after the Product loop:

{% for product in paged.results %} add the Liquid logic:

{% assign filter_out = false %}
{% for category in product.categories %}
{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% endif %}
{% endfor %}



which changes the value of filter_out to true when a Product belongs to the Categories at filtered_cats which you want to filter out. Finally before the <article> line you should add an unless:

{% unless filter_out %} and properly close it with {% endunless %}.


The final result is something similar to:

{% assign filtered_cats = "category-permalink-1|cat-perm-2|cat-perm-3" | split: "|" %}
{% paginate search.results by 8 %}
{% for product in paged.results %}
{% assign filter_out = false %}
{% for category in product.categories %}
{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% endif %}
{% endfor %}
{% unless filter_out %}
<article>
<h1 class="title-product">{{product.name}}</h1>
<h2 class="description-product">{{product.description}}</h2>
</article>
{% endunless %}
{% endfor %}
{% endpaginate %}

Optionally, to keep track of the number of products that you filter out, you can initialize a counter:

{% assign filter_out_counter = 0 %}

and increase it's value:

{% if filtered_cats contains category.id %}
{% assign filter_out = true %}
{% assign filter_out_counter = filter_out_counter | plus:'1' %}
{% endif %}

you can then use this counter to provide the correct search results number:

{{search.results.size | minus:filter_out_counter}} {% t "Item(s)" %}