Search bar that shows an error if doesn’t find any result?

Hello Ido, this code works perfectly using query, but what about if using setFilter? Which code will Be the best?
Thanks