I've never done searching from MYSQL before, but I need to implement a search. I have three tables, 'articles', 'articles_tags', and 'tags'.
'articles' holds the first thing I would like to search on, the 'title' field.
'articles_tags' is a pivot table which relates 'articles' and 'tags' together. 'articles_tags' has two fields: 'articles_id' and 'tag_id'.
'tags' holds the second thing I would like to search on, the 'name' field.
My problem is, I need a way to search the 'title' field, and each of the tags that relate to that article ('tags.name') and return a relevancy (or sort by relevancy) for article.
What would be a good way to implement this? I'm pretty sure it can't be done from just one query so two queries, and then 'mixing' the relevancies together, would be ok.
Thanks.
Edit: Forgot to say, if I could give more weighting to matching a tag than matching a word in the title, that would be awesome. I'm not really asking for anyone to write the thing, but give me some direction. I'm a bit of a newbie in both PHP and MySQL.