Search engine methods...
Posted: Wed Jun 07, 2006 12:16 am
Hi.
I have my own search engine for my website that's currently in progress. I'm using a method of keywords in the database separated by commas. My script doesn't really get the job done, if you know what I mean?
My script:
I don't really want to get into details about the code but if necessary. Basically I have the variable $_GET[search] that contains the string from the users input in the search field in a previous script. I have the $keywords which contains the string of keywords in the current selected field in the database table.
Basically all I'd need is to know some personal methods that you'd use or a link to a webpage that discuss such. I'm not at all familiar with search engines except the one I made.
Any help or post are appreciated.
Thanks.
I have my own search engine for my website that's currently in progress. I'm using a method of keywords in the database separated by commas. My script doesn't really get the job done, if you know what I mean?
My script:
Code: Select all
$_GET['search'] = trim($_GET['search']);
$search = explode(",", $keywords);
$usrsearch = explode(" ", $_GET['search']);
$l = 0;
$usrloop = 0;
$usrseachfull = "";
while ($search[$l] != "") {
$search[$l] = trim($search[$l]);
while ($usrsearch[$usrloop] != "") {
$usrseachfull .= $usrsearch[$usrloop]." ";
if ($usrsearch[$usrloop+1] == "") {
$usrseachfull = trim($usrseachfull);
}
if ((strtoupper($usrsearch[$usrloop]) == strtoupper($search[$l])) || (strtoupper($usrseachfull) == strtoupper($search[$l]))) {
//create the two blocks to display the eyecons and one to display the popups in the eyecons ($display_block, $array_block)
$display_block .= "whatever";
$i++;
}
$usrloop++;
}
$l++;
}
}Basically all I'd need is to know some personal methods that you'd use or a link to a webpage that discuss such. I'm not at all familiar with search engines except the one I made.
Any help or post are appreciated.
Thanks.