大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> 利用索引服务(Indexing Service)和ASP建立面向整个网站搜索程序,(有点像www.g

利用索引服务(Indexing Service)和ASP建立面向整个网站搜索程序,(有点像www.g

时间: 2021-07-31 作者:daque

摆设index server 在实行web效劳器上的探求之前,开始必需创造起码一个索引,并按照以次办法实行这项处事。 ⒈启用windows 2000 server效劳器上的索引。 缺省情景下采用图标坐落处置东西组中的计划机处置。窗口的右边供给对于暂时在效劳器上生存的索引消息。默许有两个索引:system和web。 ⒉要创造新的索引,用鼠标右键单击索引效劳或右边的面板,选定兴建辑录。 表露增添辑录对话框,指定索引的称呼并用欣赏按钮采用场所。索引效劳不会登时发端索引,此时将弹出一条动静框,单击决定连接。为了到达最好的本能,索引效劳不妨放在和web效劳器隔摆脱的硬盘上。 ⒊指定索引的目次,用右键单击兴建的辑录名,从弹出选单当选定属性,将展示如图2所示的对话框。 第一个选项卡惯例表露方才输出的实质,在第二个选项卡盯梢中的www效劳器下拉列表中采用你要索引的web网站。 ⒋有了创造的辑录,此刻不妨抉择你想在索引中囊括的目次。 这个宏大的个性使你能创造几个用各别办法探求实质的索引。比方,你大概想赶快欣赏从完备的文本中所引出的章节,这个个性使你能在index server内实行这项工作。要增添一个目次,用右键单击右边的面板,选定兴建目次。在展示的对话框中经过欣赏按钮采用目次并指定别号。即使必需登录到效劳器本领获得须要的实质,则不妨供给将运用的用户名和暗号,再不获得须要的实质。即使想查看受养护的实质,则更要保护实质的安定性,这一个性特殊有效,如许惟有被受权的用户(大概是那些为此付钱的人)本领获得完备的实质。 还不妨运用这个东西废除web站点中不想索引的子目次。比方,检索scripts/cgi目次就不会对用户有什么用。为此,只有双击该目次,将囊括在索引当选定于否即可,见图3。 ⒌在仍旧为站点囊括/废除了一切目次后,用右键单击右面板,从弹出选单当选定启用,从新启用index server效劳。 效劳器将发端欣赏仍旧创造的索引并发端检索实质。 源步调:1、search.asp<html><head><title>the indexing service</title><style type="text/css">body {font-family:tahoma,arial,sans-serif; font-size:10pt}.heading {font-family:tahoma,arial,sans-serif; font-size:14pt; font-weight:bold}.cite {font-family:tahoma,arial,sans-serif; font-size:8pt}</style></head><body bgcolor="#ffffff"><span class="heading">searching the indexing service using ado</span><hr><!---------------------------------------------------------------------------><form name="frmsearch" action="queryindexserver.asp" method="post">search for: <input type="text" name="txtsearchfor"><p><input type="submit" value="perform search"><input type="reset" value="clear form"></form></body></html>2、queryindexserver.asp<title>the indexing service</title><style type="text/css">body {font-family:tahoma,arial,sans-serif; font-size:10pt}.heading {font-family:tahoma,arial,sans-serif; font-size:14pt; font-weight:bold}.cite {font-family:tahoma,arial,sans-serif; font-size:8pt}.document {font-size:10pt; font-weight:bold; background-color:lightgrey; width:100%}</style></head><body bgcolor="#ffffff"><span class="heading">results of search for<i><%=request.form("txtsearchfor")%></i></span><hr><!---------------------------------------------------------------------------><% dim strsearch set rssearch = server.createobject("adodb.recordset") ' create the connection string strconn = "provider=msidxs; data source=web" ' construct the search string strsearch = "select doctitle, path, filename, characterization, size,write" & _ " from scope()" & _ " where contains ('" & request.form("txtsearchfor") & "')" ' open the recordset on the search rssearch.open strsearch,strconn ' show what's been searched for while not rssearch.eof response.write "<span class='document'>" & rssearch("doctitle") & "</span><br>" & _ rssearch("characterization") & "<br>" & _ "<a href='" & rssearch("path") & "'>" & rssearch("write") & "</a>" & _ " (" & rssearch("size") & " bytes)<p>" rssearch.movenext wend ' tidy up rssearch.close set rssearch = nothing%></body></html>沿用默许的web索引!

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.