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")
MySQL can't make a fulltext (or any) index accross multiple tables. So using a single index is out.
As an alternative, you could either:
Use an index on each table, and a join/union as appropriate to retrieve the rows that match your requirements.
Create an aggregate table to apply the index to.
Use a tool such as lucene or solr to provide your search index. (If you are going for any sort of scale, this is likely the best option)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With