Imagine a simple site, containing numerous News Items and numerous Galleries which both comprise of some text, some tags, and both of which contain one or more Photos. Each Photo can also be tagged.
In terms of URLs:
example.com/news_items example.com/news_items/alpha-item example.com/news_items/alpha-item/bravo-photo example.com/galleries example.com/galleries/charlie-item example.com/galleries/charlie-item/delta-photo
If it was just News Items that were tagged, it would be really easy to create the tag search - clicking on a tag would perhaps take you to
example.com/news_items, with the items filtered down to only items with that tag, and perhaps with UI for selecting a different tag to filter by. However, in the this case, not only is there a second type of taggable item; the Gallery, but there is also a child item of both News Item and Gallery that can be tagged: the Photo.
It is definitely useful for all three of these to be tagged, but how should the search interface work? Should all three types be returned in a single location - for example
example.com/tags. If so, how would order be decided? Which type gets priority?
Another option is to have three completely separate searches - filters as described above on
example.com/galleries, and a new URL for Photos
example.com/photos. However this feels a bit clunky and doesn't make much sense - if I click a tag
London I'd like to see news items, galleries or photos with this tag, but if I click a tag
Exhibition, I might only want to see News Items.
How should tagging and searching by tags be approached when there is more than one type of tagged item and when there is an explicit hierarchy between the tagged items.