Forums / General Questions / Add double quotes to search results

Add double quotes to search results

Started by marco_serge on 4 Dec 2014, 3:01 PM · Views: 497

Results 1 to 2 of 2
4 Dec 2014, 3:01 PM
#1
marco_serge avatar

marco_serge

New Zenner

Join Date:
Jun 2014
Location:
Modena, Italy
Posts:
24
Plugin Contributions:
0

Add double quotes to search results

Hi, I'm trying to add double-quotes to the keywords I search within my header search, but no results.

I already installed the plugin "whole word search" but it doesn't change anything.

Do someone know what file I have to edit and which line? I kinda figured out the file might be in includes/modules/pages/advanced_search_result/header_php.php but i can't find the line to edit.

Thanks

Marco

4 Dec 2014, 3:24 PM
#2
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Add double quotes to search results

I have not used this modules, but as far as I can see, you should change (around line 305)

        $where_str .= "(pd.products_name LIKE '%:keywords%'
``` to: ```php
        $where_str .= "(MATCH(pd.products_name) AGAINST ('%:keywords%' IN BOOLEAN MODE)
```and (around line 326)```php
          $where_str .= " OR pd.products_description
                          LIKE '%:keywords%'";
```to:```php
          $where_str .= " OR MATCH(pd.products_description) AGAINST ('%:keywords%' IN BOOLEAN MODE)";