Alex Rivera | Logout

MySQL full text search across multiple tables

Asked 2009-07-12T21:41:20.617
15

I have a series of tables that contain data I want to full text search. I've tried combining the tables with UNION, but the result loses its fulltext index so can't be fulltext searched. I don't think that putting the data into a temp table is the way to go. Is there someway that I can fulltext search these tables efficiently? Thanks in advance!

UPDATE: my query for fulltext was

SELECT ID, Title, Description, Author, MATCH (Title,Tags,Body) AGAINST ("search terms") AS Relevance 
FROM [combination of tables goes here] 
WHERE MATCH (Title,Tags,Body) AGAINST ("search terms")
Edit
Report

1 Answer

2

simply do:

select * from table a where a.col=myval
union
select * from table b where b.col=myval
..

indices are used as they are with a normal select.

answered 2009-07-12T21:45:52.917

Your Answer