This topic is locked

Full text search implementation

2/8/2008 11:48:30 PM
PHPRunner General questions
W
wwwguru author

any directions how to use full text search instead of original search ?
$strSQL = 'SELECT * FROM products WHERE MATCH (

NAME , KEYWORDS , SKU , MANUFACTURERID , ADVERTISERCATEGORY )

'AGAINST (\'Amerock\')';
thanks

J
Jane 2/11/2008

Hi,
use simple search on the list page and Any field option in the Search field dropdown box for this purpose.

W
wwwguru author 2/11/2008

that would do a simple search on all fields,
i'm more interested in mysql's fulltext search index and search results

Hi,

use simple search on the list page and Any field option in the Search field dropdown box for this purpose.

Alexey admin 2/12/2008

Hi,
you can modify generated ..._list.php file for this purpose.

Find and modify this snippet there:

$strWhere = "1=0";

if($where=StrWhere("Field1", $strSearchFor, $strSearchOption, ""))

$strWhere .= " or ".$where;

if($where=StrWhere("Field2", $strSearchFor, $strSearchOption, ""))

$strWhere .= " or ".$where;

if($where=StrWhere("Field3", $strSearchFor, $strSearchOption, ""))

$strWhere .= " or ".$where;

.....



I.e. replace it with:

$strWhere = "MATCH ( NAME , KEYWORDS , SKU , MANUFACTURERID , ADVERTISERCATEGORY ) AGAINST ('".$strSearchFor."')";