标题: 使用索引服务器 - 创建ASP页面
问天
元帅
Rank: 1


元帅勋章 终身成就勋章
UID 11493
精华 187
积分 34221
帖子 33355
威望 91
金币 13148
热心 2619
阅读权限 100
注册 2006-4-7
状态 离线
使用索引服务器 - 创建ASP页面

在ASP页面上一切都变得非常酷。你用表单中的值来驱动对索引服务器进行查询的对象。   
整个过程是这样的:   
◆ 打开记录集。
◆ 用标准ADO 方法,一步步地走过记录集。      
<%
"Create a Query object, initialize it using
"SetQueryFromURL, and dump the object state

   
"set the query object
Set objQuery = Server.CreateObject("ixsso.Query")   
"get the query properties set from the
"incoming URL (from the form GET operation)
objQuery.SetQueryFromURL(Request.QueryString)   
"tell the object what columns to include
objquery.columns="filename,HitCount,vpath,DocTitle,characterization"      
"open the recordset, causing the query to be
"executed
set rsQuery = objquery.createrecordset("nonsequential")   
"now, if rsquery.eof is not TRUE, then we have results
"to show. If it IS TRUE, no results were found.   
"get the page out for the user...
%>   
<html>
<head>
</head>   
<h1>Search Results</h1>
A maximum of 200 results will be returned, 20 hits per page will be shown. <br><br>
<%
if not rsquery.eof then
Response.Write rsquery.recordcount &;amp; " hit(s) were found. "
if rsquery.recordcount > 30 then
Response.Write "You may want to refine your query."
end if
Response.Write "<br>"
end if
%>   
<%
if not rsquery.eof then
while not rsquery.eof and rowcount > 0
if rsquery("doctitle") <> "" then
Response.Write "<p><b><a href="" &;amp; rsquery("vpath") &;amp; "">" &;amp; rsquery("doctitle") &;amp; "</a></b><br>"
response.write "<font size=-1>" &;amp; rsquery("characterization") &;amp; "...</font><Br>"
Response.Write "<font size=- 2>" &;amp; rsquery("hitcount") &;amp; " hit(s)</font></p>"
end if
rowcount = rowcount - 1
rsquery.movenext
wend
Response.Write "<br><Br>"
%>   

<%
else
%>   
<p>
对不起,没有发现纪录,如果要查询两个以上的词,使用and或or。
</p>      
<%
end if
%>   
</body>
</html>

   
      
  你需要做的第一件事就是建立对索引服务器对象的引用。这是通过使用server.creatobject方法来完成的:

   

Set objQuery = Server.CreateObject("ixsso.Query")

网友 问天 签名 - 网友社区 请您回个帖。谢谢
PR查询 免费域名 免费空间
顶部
[广告] 免费域名(Free Subdomain) 免费空间(Free hosting) PR查询(Google Pagerank)



当前时区 GMT+8, 现在时间是 2008-11-24 00:23
信产部ICP备案:京ICP备05066424号 北京市公安局网监备案:1101050648号

Powered by Discuz! 5.5.0
清除 Cookies - 联系我们 - 网友俱乐部 - Archiver - WAP