Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
04-28-2009, 10:53 AM #1
- Join Date
- Sep 2007
- Thanked 238 Times in 229 Posts
Searching by relevancy on multiple tables
I have 3 tables in my database (de_en,es_en,la_en), each a dictionary. Each has four columns (id,order,lang1,lang2 - lang1 and lang2 are replaced with the iso code for that language). I'm trying to build a query that will search a particular entry on all of the tables (expect to be adding more too), and sort them by relevancy. The lang1 and lang2 columns are fulltext indexes.
This is what I've created for a single table.
$q = 'word'; "SELECT *, MATCH (en) AGAINST ('" . $q . "') AS score FROM de_en WHERE MATCH (en) AGAINST ('" . $q . "') ORDER BY score DESC"
Last edited by gnomeontherun; 04-28-2009 at 11:18 AM.jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.