This has been around since long time. This quote is taken from the How do I search? help article:
To exclude results from a tag, term or phrase, prefix it with
- in your query:
waffles -unicorns finds posts that mention tasty batter-based breakfasts without including mythical creatures, while
[laurel] -[hardy] includes only posts pertaining to the first half of the classic comedy couple.
So this means if you simply enter words matching the tags available on the site, it'll automatically convert the search strings into tags. And if you want to exclude them from tags, you just need to prefix strings with a dash (
-) as said in the above quote.