创建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 & " 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="" & rsquery("vpath") & "">" & rsquery("doctitle") & "</a></b><br>"
response.write "<font size=-1>" & rsquery("characterization") & "...</font><br>"
response.write "<font size=- 2>" & rsquery("hitcount") & " 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")
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器