ok i have 3 tables (simplified for example):
table posts
---------------------------
postid int()
title varchar()
---------------------------
tags
---------------------------
tagid int()
name varchar()
---------------------------
post_tags
---------------------------
tagid int()
postid int()
---------------------------
Ok i want to be able the user to search using multiple tags to find posts. The system only allows for users to look for tags that are already in the tags table, so no need for % like % or anything. Just strait, search = tags.name.
There are 5000 posts so far and there are about 1000 tags, each post can have many tags.
The user can search for as many tags as they like.
First what is the most efficient way of doing this? I cant help the feeling that finding all the related post/tags then all the places where the tag.name = the search is super inefficient.
Finally as there can be multiple tags being searched for is there a way to make results that have all tags be at the top, then ones with multiple tags then results with only one tag.








Bookmarks