MySQL Forums
Forum List  »  Full-Text Search

Excet mach order come first in fulltext search
Posted by: Vicky Roy
Date: April 08, 2011 01:35PM

SELECT p. * , m.category_id AS cid, m.category_name ,MATCH(p.`what`, p.`description`,p.`short_description`) AGAINST ('james Bond Good Man' IN BOOLEAN MODE) OR MATCH(m.category_name) AGAINST ('james Bond Good Man' IN BOOLEAN MODE) as score FROM tbl_post AS p LEFT JOIN map_category_post AS m ON p.post_id = m.post_id WHERE (MATCH(p.`what`, p.`description`,p.`short_description`) AGAINST ('james Bond Good Man' IN BOOLEAN MODE) OR MATCH(m.category_name) AGAINST ('james Bond Good Man' IN BOOLEAN MODE) ) AND p.adult_content =0 GROUP BY p.post_id order by score desc

This query i am using to get the exact mach first order .. but here for all entry score is same(1) ....


I want exact match come should first

means matching all data with "james Bond Good Man " exect will come first and then will come match with "James bond" like that ... then match with only "James" .. then "bond" .. then "good" etec etc .... here all data is coming using the top query but ordering is not correct exact match is coming last .... please help .... Please

Options: ReplyQuote


Subject
Views
Written By
Posted
Excet mach order come first in fulltext search
3215
April 08, 2011 01:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.