Home » Php » What's a solid but basic search algorithm for php?

What's a solid but basic search algorithm for php?

Posted by: admin July 12, 2020 Leave a comment

Questions:

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!

How to&Answers:

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.

Answer:

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! 🙂