8

I am working on a project that involves searching for videos, these videos are tagged similar to how questions are tagged on stack overflow. I was wondering if anyone knows of a good 'tag-based' search algorithm.

Thanks!

ThinkingInBits
  • 10,792
  • 8
  • 57
  • 82
  • Did you try using a database indexed on tags? – Stephen May 16 '10 at 20:42
  • 2
    Bit difficult to answer without more details. Do you want searches to have to match tags exactly? If so, it's a very simple search "algorithm" (look up videos with a particular tag); and a more complex UI problem (help the user find exact matches). If not, it's a slightly more complex search problem (find similar tags, then find videos on those tags). I think you'll need to clarify how you want it to behave before anyone can help. – Dominic Rodger May 16 '10 at 20:43
  • I have a separate tags table that relates videos to tags, videos may contain multiple tags or multi-word tags – ThinkingInBits May 16 '10 at 20:43
  • Dominic, good point.. I guess the exact match part is easy, it's what to do if no 'exact matches' are found – ThinkingInBits May 16 '10 at 20:44

2 Answers2

2

Depending on what operations (write ? read ? both ?) you plan to use the most, there are different approaches.

Here an interesting reading: Tags: Database schemas comparing some well-known website tags schema.

Boris Guéry
  • 47,316
  • 8
  • 52
  • 87
0

How about searching tags, then titles, then descriptions, only widening the search from one method to the next if no results are found using the current method?

As an aside; if you want to return non-exact matches to your users, make sure they aren't so non-exact that they start becoming irrelevant! :)

Mathew
  • 8,203
  • 6
  • 37
  • 59