MySQL Forums
Forum List  »  PHP

Re: Improving Ranking of search results in a product search script
Posted by: fatjoe slim
Date: December 13, 2005 04:09PM

$query = print_r 'select *, ((MATCH(`title`) AGAINST ("'.$word.'"))*2)+((MATCH(`description`) AGAINST ("'.$word.'"))) AS relevancy FROM '.$prefix.'store_inventory where MATCH(`title`) AGAINST ("'.$word.'") and MATCH(`description`) AGAINST ("'.$word.'") ORDER BY relevancy DESC;

seems to be returning results now..

Problem is...

As you can see in the pastebin I have a sorting modification as can be seen in the Query above the current one that allowed users to sort by Price Title Description.

I am wondering how I can make the default search result sorting as it already is with Title higher in relevancy so above description matches in results, but still allow users to select their own sort method????

Second thing is, currently if i enter a search for windows xp it matches for xp or windows. How can I make it search for both terms in a product search???

Options: ReplyQuote


Subject
Written By
Posted
Re: Improving Ranking of search results in a product search script
December 13, 2005 04:09PM


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.