繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP应用 >> 使用索引服务器 - 创建ASP页面

使用索引服务器 - 创建ASP页面

2004-10-01 08:26:10  作者:  来源:互联网  浏览次数:5  文字大小:【】【】【
简介:创建ASP页面   在ASP页面上一切都变得非常酷。你用表单中的值来驱动对索引服务器进行查询的对象。 整个过程是这样的: ◆ 打开记录集。 ◆ 用标准ADO 方法,一步步地走过记录集。 <% "Create a Qu...
关键字:索引 页面 服务器 ASP

创建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...

%>

Search Results

A maximum of 200 results will be returned, 20 hits per page will be shown.

<%

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 "
"

end if

%>

<%

if not rsquery.eof then

while not rsquery.eof and rowcount > 0

if rsquery("doctitle") <> "" then

Response.Write "

" & rsquery("doctitle") & "
"

response.write "" & rsquery("characterization") & "...
"

Response.Write "" & rsquery("hitcount") & " hit(s)

"

end if

rowcount = rowcount - 1

rsquery.movenext

wend

Response.Write "

"

%>

<%

else

%>

对不起,没有发现纪录,如果要查询两个以上的词,使用and或or。

<%

end if

%>

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

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

责任编辑:admin
相关文章