搜索实现
来源:互联网 发布:mac webpack打包 编辑:程序博客网 时间:2024/05/17 01:59
//拆分关键字 提取的时候 注意使用 trim($result[i] ) 把前后空格去掉
function text_explode($strTemp)
{
$oldArray=array( " "," "," "," "," ","," );
$newArray=array("|","|","|","|","|","|");
$newphrase=str_replace($oldArray,$newArray,$strTemp);
$newphrase=str_replace("|||","|", $newphrase);
$newphrase=str_replace("||","|", $newphrase);
// echo $newphrase;
$result=explode("|",$newphrase);
// echo "<br />";
// print_r($result);
return $result;
}
// 应用在 select * from tbl_user where id in('1','2','3')
//同理 也可用于 多个删除 delete from tbl_user where id in('1','2','3')
function implodeids($array)
{
if(!empty($array)) {
return "'".implode("','", is_array($array) ? $array : array($array))."'";
} else {
return '';
}
}
function text_explode($strTemp)
{
$oldArray=array( " "," "," "," "," ","," );
$newArray=array("|","|","|","|","|","|");
$newphrase=str_replace($oldArray,$newArray,$strTemp);
$newphrase=str_replace("|||","|", $newphrase);
$newphrase=str_replace("||","|", $newphrase);
// echo $newphrase;
$result=explode("|",$newphrase);
// echo "<br />";
// print_r($result);
return $result;
}
// 应用在 select * from tbl_user where id in('1','2','3')
//同理 也可用于 多个删除 delete from tbl_user where id in('1','2','3')
function implodeids($array)
{
if(!empty($array)) {
return "'".implode("','", is_array($array) ? $array : array($array))."'";
} else {
return '';
}
}
建立 searchIndex 中间表 用于存储 搜索关键字。中对应的 要搜索 物品的id,
在搜索的时候先 查询该关键字 是否在 tbl_searchindex表中存在 如果有 就直接通过searchid来去 物品Id,
再生产物品列表.、
如果没有就 先搜索物品列表 把物品列表 和关键字 放入searchindex 起到了搜索缓存效果。
在搜索中 使用( or ) and ( or )
每个or 语句尽量要考虑是否可以用union 语句
还要把 基本上用的 标签 搜索添加到热门搜索 列表中去
- 搜索实现
- 实现搜索
- sql实现搜索功能
- 内存搜索设计实现
- ASP实现智能搜索
- 实现搜索功能
- JAVA实现文件搜索
- 实现Google搜索
- android搜索框实现
- 二叉搜索树实现
- JQUERY实现搜索提示
- 搜索 云标签实现
- android搜索框实现
- C#实现byte[]搜索
- 实现文件夹搜索
- android搜索框实现
- 实现百度搜索效果
- sharepoint:实现搜索功能
- 2007十大网络新名词
- [Linux] linux下的GetModuleFileName函数
- 用Java EE 5实现的网上书店实例文件下载- (NetBeans 6.0)
- 回首以往
- XML-RPC协议
- 搜索实现
- TinyXML中文文档
- 关于log4j
- 转:邹建--比较两个数据库的表结构差异2
- vbs之createobject大全
- vba使用win32 API(GetOpenFileName )实现打开文件对话框
- ArcGIS 9.2将支持SVG格式
- TinyXml Documentation 2.5.1
- 错误大杂烩