关于搜索引擎的问题。

coo_key 2002-10-24 10:28:55
小弟现在做一个很简单的搜索判断(算不上是搜索引擎)只是提供类似于GOOGLE的那些用户关键字输入判断,比如用户输入and & + 空格 逗号 or | "" ()这些的判断,我现在用VBS做了一个函数,用for循环分解所有的情况,然后在对每个分解的进行全文检索,这样的话可是运行起来速度很慢?有哪位大侠做过类似的东西,帖出来,供小弟研究一下。
简单的说就是把用户输入的文字翻译成为SQL语句/
我现在还没有做出怎么判断用户输入的查询中有“”和()的情况,很苦闷呀,大侠帮帮我,这一百分就是你的了。
...全文
27 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
coo_key 2002-10-24
  • 打赏
  • 举报
回复
TO freezwy(网络自由人) :
哪里有下?给个地址呀,老大!
coo_key 2002-10-24
  • 打赏
  • 举报
回复
只有单个关键字的判断肯定不行了。呵
如果是这样的话:"web java"你的就变成了webjava就查不到了~~~~~~~
freezwy 2002-10-24
  • 打赏
  • 举报
回复
你现在去找《搜索引擎技术内幕》这本电子书,看后你就明白算法和策略了。
cdsun 2002-10-24
  • 打赏
  • 举报
回复
<%
key=trim(request.querystring("key"))
'key=trim(request.querystring("searchtype"))
if key="" then
sql="select * from news"
else
sql="select * from news where title like '%"&key&"%' order by id desc"
end if

%>
<%
set rec=server.createobject("adodb.recordset")
rec.open sql,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站信息搜索</title>
<base target="_self">

</head>

<body topmargin="0" leftmargin="0" bgcolor="#FFFFFF" link="#000000" vlink="#000000"

alink="#000000">
<!-- #EndLibraryItem -->
<table width="777" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="165" bgcolor="628EA7" height="20" align="center">
 
</td>
<td width="612" class="top1" height="20" bgcolor="628EA7"> </td>
</tr>
<tr>
<td width="165" bgcolor="628EA7" valign="top">
 
</td>
<td width="612" background="../policy/images/background.jpg" valign="top">
<table width="20" border="0" cellspacing="0" cellpadding="0" height="20">
<tr>
<td></td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="2" width="98%" height="72"

align="center" class="font9pt-Black">
<tr bgcolor="628EA7">
<td width="83" height="25" bgcolor="628EA7" style="color: #FFFFFF; font-size: 9pt;

font-weight: bold" align="center">
<p align="center"><font color="#FFFFFF">查询类型</font>
</td>
<td width="213" height="25" style="color: #FFFFFF; font-size: 9pt; font-weight:

bold" align="center">查询标题</td>
<td width="182" height="25" style="color: #FFFFFF; font-size: 9pt; font-weight:

bold" align="center">来源</td>
<td width="66" height="25" style="color: #FFFFFF; font-size: 9pt; font-weight:

bold" align="center">发布日期</td>
</tr>
<tr bgcolor="#F6F6F6" align="center">
<td height="30" colspan="5" class="font9pt-black" > <font color="#FF0000">共检索到

<%=rec.recordcount %>条新闻信息</font></td>
</tr>
<%if rec.recordcount = 0 then %>
<tr bgcolor="#F6F6F6">
<td colspan="5" height="18" align="center" class="font9pt-White"><font

color="#FF0000">对不起,没有查询到相关信息!</font></td>
</tr>
<%end if %>
<% do while not rec.eof %>
<tr bgcolor="#F6F6F6">
<td width="83" height="25" align="center" class="font9pt-White"><font

color=green><%=session("searchtype")%></font></td>
<td width="213" height="25" align="center" class="font9pt-White"><font

color=green><a

href="news.asp?ID=<%=rec("id")%>&menu=<%=types%>"><%=rec("title")%></a></font> </td>
<td width="182" height="25" align="center"> <%=rec("source")%></td>
<td width="66" height="25" align="center"><%=rec("pubdate")%></td>
</tr>
<%
rec.movenext
loop
set rec=nothing
set conn=nothing
%>
</table>
</td>
</tr>
</table>

</body>

</html>


看看吧

説不定可以幫商你

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧