动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   .Net → 阅读文章

 index server example

作者来源: 
阅读 1200 人次 , 2006-4-26 9:51:00 


<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 = *\advice\draft* "
myquery=myquery & " and not #Vpath = *\aspmagazine\new* "
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 = *\charlescarroll\draft* "

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 = *\learn\cover* "

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 = *\upload\tests* "

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

  
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:用asp怎样编写文档搜索页面
· 下一篇:一起特殊中文全文检索问题的解决
· ASP.NET虚拟主机的重大安全隐患(三)
· Microsoft .NET 框架常见问题(二)
· 基于ASP.NET与XML的网络硬盘开发
· P2P的简单示例(VB.net版)
· 第一章 C#简介


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077