Tags AND Tags OR Tags

by Jeff Atwood

on October 13, 2008

Until recently, we hadn't done a good job of providing a user interface for combining tags. You'll notice that all the question browsers now show "related tags", with a count of how many tags are shown for whatever view you happen to be in (with the exception of search):


Let's say I clicked on the Python tag, anywhere on the Stack Overflow site. Clicking on a tag zips you away to a view of all the questions within that particular tag. Within the tag view, you can sort and browse as expected, but you can also click the related tags in the right sidebar to combine tags, like so:


This isn't exactly new; you could always do this manually in the URL by space delimiting the tags. However, these were always implicit ands, as in:

Show me all the questions tagged _both_ "python" **AND** "django" > > [http://stackoverflow.com/questions/tagged/python django](http://stackoverflow.com/questions/tagged/python django)

We also support a slightly shorter synonym of this URL that does the same thing:

http://stackoverflow.com/tags/python django

But maybe that's too specific for your tastes. Now you use the new or pseudo tag:

Show me all the questions tagged _either_ "python" **OR** "django" > > [http://stackoverflow.com/questions/tagged/python or django](http://stackoverflow.com/questions/tagged/python or django)


We also support NOT if you prefix the tag with a dash, like so:

Show me all the questions tagged "python" **BUT NOT** tagged "django" > > [http://stackoverflow.com/questions/tagged/python -django](http://stackoverflow.com/questions/tagged/python -django)


This works throughout the site, including questions, unanswered questions, and all tag based RSS feeds. Anywhere on Stack Overflow you can specify a tag, you now specify multiple tags with or without the or clause.

I'm not sure if that's super or awesome. I haven't decided yet.

But either way, it was definitely a highly ranked request from a lot of users.