It’s already supported ….
If you try a search now, look at the url.. you’ll have something like..
yoursite.com/?s=searchterm
Add this onto the end..
&tag=tagname
..hit enter..
The query should then filter the posts by matching tag….
If you want to search by TAG alone you’ll need to modify the main query (query_posts) just as you would with other template files.
If you want to print out the query_vars (so you can see what’s being populated on search)…
<pre>
<?php print_r($wp_query->query_vars); ?>
</pre>
I’m still fiddling around with the search page myself, and i’m not sure what the correct procedure for passing strings to the search function are…
Here’s what i’m toying around with at the moment (simply so you can see what i’m doing in mine)… (don’t use it on a live site, take what you need from it, if it helps)..
https://wordpress.pastebin.com/f58012dc1