ThinkingInBits
ThinkingInBits

Reputation: 11432

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!

Upvotes: 8

Views: 796

Answers (2)

Mathew
Mathew

Reputation: 8279

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! :)

Upvotes: 0

Boris Guéry
Boris Guéry

Reputation: 47585

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.

Upvotes: 2

Related Questions