Filter on Search?

Let’s say I have ten products. Each product has a title and some tags.

After searching (search-source), I want to filter the search results. How should I do that?

I am trying something similar, but the code I wrote doesn’t work. You can see what I did tried here