Hello,
Is there a way to give one column a higher priority than all the rest when doing a relevance search?
I have a relevance search to rank my listings and display the most relevant one, but there is an issue... on a particular word, I get 5 listings returned with the same relevance, if this happens, I would like it if the word was found in menuName, then that should be first as it is the most relevant. Here is my code:
SELECT listings.*,menuitems.menuName, menuitems.menuDescription,(((acos(sin((-123.450461*pi()/180)) * sin((listinglat*pi()/180))+cos((-123.450461*pi()/180)) * cos((listinglat*pi()/180)) * cos(((48.579731- listinglong)*pi()/180))))*180/pi())*60*1.1515*1.609344) as distance ,MATCH (listingName,listingDescription,listingAddress1,listingAddress2,listingPostalCode,listingCity,listingProvince,listingPhone,listingFax,listingEmail,listingWebsite,listingLocation,menuName,menuDescription) AGAINST ('(lemongrass) ("lemongrass") (+lemongrass)' IN BOOLEAN MODE) AS relevance FROM listings,menuitems WHERE (MATCH (listingName,listingDescription,listingAddress1,listingAddress2,listingPostalCode,listingCity,listingProvince,listingPhone,listingFax,listingEmail,listingWebsite,listingLocation,menuName,menuDescription) AGAINST ('(lemongrass) ("lemongrass") (+lemongrass)' IN BOOLEAN MODE) OR menuitems.menuName LIKE '%lemongrass%' OR menuitems.menuDescription LIKE '%lemongrass%') AND menuitems.listingID = listings.listingID GROUP BY listingID ORDER BY relevance DESC
Here is the result, obviously you can see, the only place with lemongrass in the name is the last one... how do I make that the top one, if all the results are the same relevance?
The Mint
Golden Chopsticks Chinese Restaurant
Temple Restaurant and Lounge
The Local Bar and Grill
Lemongrass Cafe