views:

26

answers:

0

Heya

I need help with my MySQL product search query.

Overall I'd appreciate any critique / tweak suggestions, more importantly though I have an issue..

I implemented this to stop people searching: "ipod" & getting "tripod" at the top of the list..

now my issue.. search for "dg43nb" I get 0 results but should get title:"BOXd43nb"

So I need some guidance as to what my options are here. Cause I don't wanna ruin the results and get tripod at the top again :| Below is my query as it stands..

SELECT SQL_CALC_FOUND_ROWS , IF((categoryin ('dg43nb')),3,1)+ MATCH(title) AGAINST('+dg43nb' IN BOOLEAN MODE)3+ MATCH(description) AGAINST('+dg43nb' IN BOOLEAN MODE)*0.2 AS score FROM inventory i LEFT JOIN category c ON i.cat_id = c.cat_id WHERE MATCH(title,description) AGAINST('+dg43nb*' IN BOOLEAN MODE) OR product_code = 'dg43nb' ORDER BY score desc

any advice appreciated.