more accuate search

IS there a way to get search to work better? I notice that when ever myself or search for products the results have nothing to do with what they are searching for. My other shop runs oscommerce and that search is always on point.

In “side_boxes/search.tpl” add the part in red below:


```php











[COLOR=Red][/COLOR]
```

thanks … it worked great. you are the king!

Hi,



Now search looks in to description also. I do not need this. I need search to check only item titles.



For example I look for “round bead necklace”



It also finds “Beaded necklace” course in item full description there is “Beads are rounded (not sharp)”



How can I setup this?



Thank you.

In “include/common/search_products.php”, try commenting the part in red below out:



foreach ($pieces as $piece) {
$tmp = array();
if ($search_data['search_product_name'] == 'Y') {
$tmp[] = "descr1.product LIKE '%$piece%'";
}
[COLOR=Red] if ($search_data['search_short_description'] == 'Y') {
$tmp[] = "descr1.short_description LIKE '%$piece%'";
}
if ($search_data['search_full_description'] == 'Y') {
$tmp[] = "descr1.full_description LIKE '%$piece%'";
}[/COLOR]
if ($search_data['search_keywords'] == 'Y') {
$tmp[] = "(descr1.meta_keywords LIKE '%$piece%' OR descr1.meta_description LIKE '%$piece%')";
$tmp[] = "(descr1.search_words LIKE '%$piece%')"; // check search words
}
if (is_array($search_data['search_product_features']) && $action != 'feature_search') {
$tmp[] = "$db_tables[product_features_values].value LIKE '%$piece%'";
}

if (!empty($tmp)) {
$_condition[] = ' (' . implode(' OR ', $tmp) . ') ';
}
}

Works great! Thank you :slight_smile:


[quote name=‘mdekok3000’]In “include/common/search_products.php”, try commenting the part in red below out:



foreach ($pieces as $piece) {
$tmp = array();
if ($search_data['search_product_name'] == 'Y') {
$tmp[] = "descr1.product LIKE '%$piece%'";
}
[COLOR=Red] if ($search_data['search_short_description'] == 'Y') {
$tmp[] = "descr1.short_description LIKE '%$piece%'";
}
if ($search_data['search_full_description'] == 'Y') {
$tmp[] = "descr1.full_description LIKE '%$piece%'";
}[/COLOR]
if ($search_data['search_keywords'] == 'Y') {
$tmp[] = "(descr1.meta_keywords LIKE '%$piece%' OR descr1.meta_description LIKE '%$piece%')";
$tmp[] = "(descr1.search_words LIKE '%$piece%')"; // check search words
}
if (is_array($search_data['search_product_features']) && $action != 'feature_search') {
$tmp[] = "$db_tables[product_features_values].value LIKE '%$piece%'";
}

if (!empty($tmp)) {
$_condition[] = ' (' . implode(' OR ', $tmp) . ') ';
}
}
[/QUOTE]