1, 到 管理工具 ---> 服务 ---> Indexing Service 组件 (激活并设置自动)
2. 在wwwboot 根目录 建立 search.asp
3.在IIS 运行 search.asp 完成
search.asp
<script language="vbscript" RunAt="Server"> Dim SearchScope,LocaleID,QryStr Dim ASPFile,NewQuery,UsedQuery Dim PageSize Dim NextPgNo,NextRecNo,CurrentPage Dim ActiveQuery Dim Rs,Q,util Sub Initialize() SearchScope="/" LocaleID="ZH-CN" PageSize=20 NewQuery=FALSE UsedQuery=False QryStr="" ASPFile=Request.ServerVariables("PATH_INFO") ENd sub
Sub Judge_Method() if Request.ServerVariables("REQUEST_METHOD")="POST" then QryStr=Request.Form("QryStr") if Request.Form("Action")="执行" then NewQuery=True end if end if if Request.ServerVariables("REQUEST_METHOD")="GET" then QryStr=Request.QueryString("qu") SearchScope=Request.QueryString("sc") if Request.QueryString("pg")<>"" then NextPgNo=Request.QueryString("pg") NewQuery=false UsedQuery=true else NewQuery=QryStr<>"" end if end if end sub
sub Show_Mainform() Response.write "<font size=+3><b>全文数据检索系统</b></font>" Response.write "<Form action='"& ASPFile &"' METHOD=Post>" Response.write "请输入查询的字符串:" Response.write "<input type='text' name='QryStr' Size=46 MAXLENGTH=100 VALUE='"&QryStr&"'>" Response.write " <input type='submit' name='Action' value='执行'>" Response.write " <input type='reset' name='Cleat' value='清除'>" Response.write "<ht></form>" end sub
sub Init_ixsso() Dim StrLen if NewQuery then Set Session("Query")=Nothing Set Session("Recordset")=Nothing NextRecNo=1 strLen=len(QryStr) if left(QryStr,1)=chr(34) then StrLen=Strlen-1 Qrystr=right(QryStr,StrLen) end if if right(QryStr,1)=chr(34) then StrLen=StrLen-1 Qrystr=Left(QryStr,StrLen) end if Set Q=server.createobject("ixsso.Query") set util=Server.Createobject("ixsso.Util") Q.Query=QryStr Q.SortBy="rank[d]" Q.Columns="DocTitle,vpath,filename,size,write,characterization,rank" Q.MaxRecords=3000 if SearchScope <>"/" then util.AddScopeToQuery Q,SearchScope,"deep" end if if LocaleID<>"" then Q.LocaleID=util.ISOToLocaleID(LocaleID) end if set Rs=Q.CreateRecordSet("nonsequential") Rs.pagesize=PageSize ActiveQuery=true else UsedQuery=true if Isobject(Session("Query")) and IsObject(Session("RecordSet")) then set Q=Session("Query") set RS=Session("RecordSet") if Rs.RecordCount<>-1 and NextPgNo <>-1 then Rs.AbsolutePage=NextPgNo NextRecNo=Rs.AbsolutePosition end if ActiveQuery=true else Response.write "错误 - 尚无任何查询条件!" end if end if End Sub
Sub show_Query() Dim LastRecordOnPage if ActiveQuery then if not Rs.Eof then LastRecordOnPage=NextRecNo+Rs.PageSize - 1 CurrentPage=Rs.Absolut [1] [2] [3] 下一页 |