Running FULLTEXT Search on two tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Running FULLTEXT Search on two tables

Post by kendall »

Hello,

i have 2 tables 'product' and 'product_features' . products table has name and description while product features has the product's code and attribute I have created an individual FULLTEXT search for name, description and attribute.

i am trying to do a search that returns the results from the products table based on searches from both the products and the products_features table but i am having a hard time writing the query string

this is what i have so far
SELECT * FROM product, features WHERE MATCH(name) AGAINST('magnum, television, screen') OR MATCH(description) AGAINST('magnum, television, screen') AND MATCH(attribute) AGAINST('magnu, television, screen') GROUP BY features.code
Turns out sort of ok but i want to really bring out the results of the product code based on the
AND MATCH(attribute) AGAINST('magnu, television, screen') GROUP BY features.code

Am i going to far fetched here?

Kendall
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

YO guys,

Well i have been trying really i have....came up with this.
SELECT product.code, product.name, product.description, product.image, product.available FROM product, features WHERE MATCH(features.attribute) AGAINST('Samsung Television with 4 picture settings') AND product.code = features.code OR MATCH(product.name) AGAINST('Samsung Television with 4 picture settings') GROUP BY features.code
Still hasnt been giving me the best results

Any suggestions welcomed

Kendall
Post Reply