You are here:  » Blended Keywords Search Results

Support Forum



Blended Keywords Search Results

Submitted by mikecdprice on Thu, 2011-09-15 18:00 in

Hello,

Is it possible to Blend search results for the products together like:

Love, Tigger, WWE, Nurse

and even though they are not all on the product name or description if they have this keyword there would appear in the search results blended with the keywords,placed,above

Is that possible?

I am test an idea I have ;)

Thank you,
Michael

Submitted by support on Fri, 2011-09-16 10:24

Hi Michael,

It would be straight forward to add a blended: search operator. Look for the following code at line 73 of search.php:

      case "merchant":

...and REPLACE with:

      case "blended":
        $wheres = array();
        $words = explode(" ",$parts[1]);
        foreach($words as $word)
        {
          $wheres[] = "name LIKE '%".database_safe($word)."%'";
        }
        $where = implode(" OR ",$wheres);
        $sql = "SELECT SQL_CALC_FOUND_ROWS * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." GROUP BY name";
        $orderBySelection = $orderByDefault;
        break;
      case "merchant":

Then use without the comma separation, e.g.

blended:love tigger WWE Nurse

Cheers,
David.
--
PriceTapestry.com