帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
index server example
作者:佚名 发布时间:2005-04-02 来源:不详
 <html><head>
<title>iskeyword.asp</title>
</head><body bgcolor="#FFFFFF">
<Form action = "iskeywordRespond.asp" method="get">
Choose The Word You Want to Search For::<p>
Search Word: <Input NAME="Keyword" size ="30"><br>
<Input type="submit" value="Find The Documents!">
</form>
</body></html>
The iskeywordrespond.asp looks like this:
<html><head>
<title>iskeywordrespond.asp</title>
</head>
<body>
<%
Set objQuery = Server.CreateObject("ixsso.query")
Set objUtil = Server.CreateObject("ixsso.util")
my_keyword=request("keyword")

objquery.catalog="learnasp"

' keyword search
myquery=myquery & "$contents " & my_keyword

' Exclude specific folders
%>
<!--#include virtual="/search/exclude.asp"-->

<%
' Exclude specific filenames
myquery=myquery & " and not #filename indexmaster.asp"
myquery=myquery & " and not #filename index.asp"
myquery=myquery & " and not #filename indexold.asp"

' Exclude specific extensions
myquery=myquery & " and not #filename *.|(txt|,inc|,htm|,mdb|,cnt|,class|,toc|,html|,css|)"

objQuery.Query=myQuery
objQuery.Columns = "Vpath, DocTitle, Filename, Characterization, Contents,DocKeyWords, Rank"
objQuery.SortBy = "Rank [d]"
objQuery.MaxRecords = 50
objUtil.AddScopeToQuery objQuery, "/", "DEEP"

linebr="<br>" & vbcrlf
Set rstemp = objQuery.CreateRecordSet("nonsequential")
DO UNTIL rstemp.eof
FOR EACH key in rstemp.fields
keyname=lcase(key.name)
SELECT CASE keyname
CASE "vpath"
response.write "<a href='"
response.write key
response.write "'>" & key & "</a>" & linebr
CASE ELSE
response.write "<b>" & keyname & ":</b>" & linebr
response.write key & linebr
END SELECT
NEXT
response.write "<br><hr>"
? rstemp.movenext
LOOP
' clean up
rstemp.close
set rstemp=nothing
Set objQuery = nothing
Set objUtil = nothing
%>
</body>
</html>
It has to exclude many folders on my site and the following file excludes directories:

<%
myquery=myquery & " and not #Vpath = **_* "
myquery=myquery & " and not #Vpath = *_contents* "
myquery=myquery & " and not #Vpath = *_raw* "

myquery=myquery & " and not #Vpath = *ads* "
myquery=myquery & " and not #Vpath = *aspace* "
myquery=myquery & " and not #Vpath = *advicedraft* "
myquery=myquery & " and not #Vpath = *aspmagazinenew* "
myquery=myquery & " and not #Vpath = *aspfuture* "
myquery=myquery & " and not #Vpath = *asptraining* "
myquery=myquery & " and not #Vpath = *aspynews* "
myquery=myquery & " and not #Vpath = *activeserverpages* "
myquery=myquery & " and not #Vpath = *contribute* "
myquery=myquery & " and not #Vpath = *cst* "
myquery=myquery & " and not #Vpath = *charlescarrolldraft* "

myquery=myquery & " and not #Vpath = *dcline* "
myquery=myquery & " and not #Vpath = *drafts* "

myquery=myquery & " and not #Vpath = *experiments* "

myquery=myquery & " and not #Vpath = *future* "

myquery=myquery & " and not #Vpath = *home* "
myquery=myquery & " and not #Vpath = *how* "

myquery=myquery & " and not #Vpath = *images* "

myquery=myquery & " and not #Vpath = *library* "
myquery=myquery & " and not #Vpath = *learncover* "

myquery=myquery & " and not #Vpath = *private* "
myquery=myquery & " and not #Vpath = *perlscript* "

myquery=myquery & " and not #Vpath = *reference* "
myquery=myquery & " and not #Vpath = *redesign* "

myquery=myquery & " and not #Vpath = *search* "
myquery=myquery & " and not #Vpath = *searchasplists* "
myquery=myquery & " and not #Vpath = *secret* "
myquery=myquery & " and not #Vpath = *sites* "
myquery=myquery & " and not #Vpath = *search* "
myquery=myquery & " and not #Vpath = *speedsitelaws* "
myquery=myquery & " and not #Vpath = *start* "

myquery=myquery & " and not #Vpath = *trash* "
myquery=myquery & " and not #Vpath = *test* "

myquery=myquery & " and not #Vpath = *upload* "
myquery=myquery & " and not #Vpath = *uploadtests* "

myquery=myquery & " and not #filename indexmaster.asp"
myquery=myquery & " and not #filename index.asp"
myquery=myquery & " and not #filename indexold.asp"
myquery=myquery & " and not #filename *.|(txt|,inc|,htm|,mdb|,cnt|,class|,toc|,html|,css|)"
%>
  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·JScript 方法 - lastIndexOf 方法  (2005-03-12)
 ·JScript 方法 - indexOf 方法  (2005-03-12)
 ·SQL Server同Index Server的结合  (2005-03-12)
 ·SQL Server同Index Server的结合  (2005-03-12)
 ·关于INDEX SERVER+ASP建立查询引  (2005-03-12)
 ·利用索引服务(Indexing Service)  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统