What's a solid but basic search algorithm for php?
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!
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.
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! :)
精彩评论