I would like to know if anyone knows of tutorial for writting a search that will do this type of thing
add s es 's or ies to the search word
take those options off the search
a search for man would also enclude men or male
We have an exact search at the moment, which is great, but I'd like to have a play with looking for both singukars and plurals....
Or if anyone just knows the two different codes
I have this at the moment in the script I'm playing with, but obviously it doesn't work
$all_ex=array_merge ( $as_ex,$ty_ex,$fi_ex);
if($searchfor){
$searchfor=str_replace ( " and ", " +",$searchfor);
$searchfor=str_replace ( " not ", " -",$searchfor);
$searchfor=str_replace ( " AND ", " +",$searchfor);
$searchfor=str_replace ( " NOT ", " -",$searchfor);
$searchfor=str_replace ( " OR ", " ",$searchfor);
$searchfor=str_replace ( " or ", " ",$searchfor);
/*
$searchfor=$searchfor.' ';
$searchfor=str_replace(' ',' ',$searchfor);
$searchfor=str_replace ( "'", "",$searchfor);
$searchfor=str_replace ( '"', "",$searchfor);
$searchfor=str_replace ( "+ ", "+",$searchfor);
$searchfor=str_replace ( "- ", "-",$searchfor);
explode(' ',$searchfor);
if(strstr($searchfor,' ')){$searchfors=str_replace ( ' ', "s ",$searchfor);}
if(strstr($searchfor,'s ')){$searchforxs=str_replace ( 's ', " ",$searchfor);}
if(strstr($searchfor,' ')){$searchfores=str_replace ( ' ', "es ",$searchfor);}
if(strstr($searchfor,'es ')){$searchforxes=str_replace ( 'es ', " ",$searchfor);}
if(strstr($searchfor,'y ')){$searchfories=str_replace ( 'y ', "ies ",$searchfor);}
if(strstr($searchfor,'ies ')){$searchforxies=str_replace ( 'ies ', "y ",$searchfor);}
$searchfor=$searchfor.' '.$searchfors.' '.$searchfores.' '.$searchfories.' '.$searchforxs.' '.$searchforxes.' '.$searchforxies;
Regards Lynny