vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi everybody, I need some help. I've started to develop a search for my site, and I'm using FULLTEXT index After all, I created the indexs in the required search fields "title" and "text": ALTER TABLE table1 ADD FULLTEXT(title, text); and with the following query: SELECT * FROM table1 WHERE MATCH(title, text) AGAINST ('SeachString'); returns me the results that I want, for the search in table1. Until now, everything works fine. I want to include on this search: table2 and table3, both tables have different structure, but they have the some common fields, title and text. Is there any way to put in the same query, the search for a string in 3 differents tables? |
| ||||
| == Quote from saavedrajj (saavedrajj@gmail.com)'s article > Hi everybody, I need some help. I've started to develop a search for > my site, and I'm using FULLTEXT index > After all, I created the indexs in the required search fields "title" > and "text": > ALTER TABLE table1 ADD FULLTEXT(title, text); > and with the following query: > SELECT * FROM table1 WHERE MATCH(title, text) AGAINST ('SeachString'); > returns me the results that I want, for the search in table1. > Until now, everything works fine. > I want to include on this search: table2 and table3, both tables have > different structure, but they have the some common fields, title and > text. > Is there any way to put in the same query, the search for a string > in 3 differents tables? as long as you're retrieving the same fields (data type and field name), i believe you can add a union and retrieve the combined results. -- POST BY: lark with PHP News Reader |