We have a MySQL database, which has three tables:
Objects Composite Tags
+-----+-----+ +-----+-----+ +-----+-----+
| ID | Name| |ObjID|TagID| | ID | Name|
+-----+-----+ +-----+-----+ +-----+-----+
Objects and tags tables are indexed and we're using Sphinx Search engine (can be changed if need be).
When an object search is ran, we get the object IDs from the search engine and then check the composite table via MySQL query to find what the objects' tags are.
The problem is, when we try to search within tags and get several tag results, we need to first get ALL the objects that are tied to those tags (currently, MySQL is doing this part) and then go back to find what their tags are (again, MySQL is doing this part). Since we're going to have more than a few million objects, this will mean death for our tiny little server if enough requests are ran and this part really needs some optimization.
What we're looking for is either a search engine that can index composite tables efficiently or do searches joining these tables together. Do any of you know about a search engine that can handle these tasks (so far nothing we've seen can) or should we take a different approach to this problem altogether?