You are here:  » Search result based on category priorities

Support Forum



Search result based on category priorities

Submitted by technoarenasol on Thu, 2012-11-22 09:09 in

Hi David

Some time search box not give accurate result like If any search "samsung galaxy" than get 1st result from Mobile accessories category not from mobile category

So can be possible to first check result from mobile and after that check result from mobile accessories .....

example link :http://example.com/mobile/search.php?q=samsung+galaxy&x=0&y=0

here 1st two result come from mobile accessories than give mobile phone result ....

Submitted by support on Thu, 2012-11-22 13:22

Hi Amin,

Ordering specifically by category would lose the benefits of the full text relevancy search; but one option to consider which a number of users have implemented is to apply a secondary sort by price DESC to the relevance sort; which you can try as follows. In search.php look for the following code at line 53:

    $orderByDefault["rating"] = "rating DESC";

...and REPLACE with:

    $orderByDefault["relevance"] = "minPrice DESC";
    $orderByDefault["rating"] = "rating DESC";

(the above ADDS a relevance sort clause of the default search method as it doesn't have a relevance clause in the distribution as it's only a feature of the full text index)

Then look for the following code at line 61:

    $orderByFullText["relevance"] = "relevance DESC";

...and REPLACE with:

    $orderByFullText["relevance"] = "relevance DESC, minPrice DESC";

Hope this helps!

Cheers,
David.
--
PriceTapestry.com