adding fulltext query to existing query
Posted: Sun Aug 29, 2010 10:57 am
I am struggling to work out the syntax for joining a normal multi table query with single table fulltext. I can't get my head around the syntax
This is the existing syntax which works fine:
My efforts to add fulltext are not cutting it. This is the query i am trying to use fo the search:
This is what i came up with, but for (probably obvious) reasons unknown to me, its not working.
Any help would be much appreciated!
This is the existing syntax which works fine:
Code: Select all
SELECT * FROM products,categories,sub_categories
WHERE products.approved = 1
AND products.main_category = categories.id
AND products.sub_category = sub_categories.id Code: Select all
MATCH(product_name,code,tag_1,tag_2,tag_3,tag_4,tag_5,details)
AGAINST ('keyword') AS score FROM products
WHERE MATCH(product_name,code,tag_1,tag_2,tag_3,tag_4,tag_5,details) AGAINST('keyword') Code: Select all
SELECT * FROM products,categories,sub_categories
WHERE products.approved = 1
AND products.main_category = categories.id
AND products.sub_category = sub_categories.id
AND MATCH(product_name,code,tag_1,tag_2,tag_3,tag_4,tag_5,details)
AGAINST ('keyword') AS score FROM products
WHERE MATCH(product_name,code,tag_1,tag_2,tag_3,tag_4,tag_5,details) AGAINST('keyword')