急!!!给tripofdream(梦之旅)和能解决全文检索的高手!

runqi 2001-07-16 11:44:45
谢谢tripofdream(梦之旅)的热心帮助,我在WIN2000 SERVER 上也试过了,同样的结果,能再帮我想想办法吗!


我的asp全文检索程序运行后,可得到文件名,但路径为空,在计算机管理里,检索确可得到路径,即可链接。我用的是
<% set objquery=server.CreateObject ("ixsso.query")
objQuery.Query = Request("txtQuery")
objQuery.Columns="filename,vpath,DocTitle"
objQuery.Catalog = "aa"
objQuery.MaxRecords = 50
Set rsQuery = objQuery.CreateRecordset("nonsequential")
%>
.
.
.
<a href="<%= rsQuery("vpath") %>"> <% = server.htmlencode(rsQuery("doctitle")) %></a>  

我把vpath用response.write显示出来了,为空,不知在index server上有没有特殊设置的东西?不知为何,请教高手!


另问,全文检索能否查到.asp文件,点击后会出现什么?


...全文
117 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
dotnba 2001-07-16
  • 打赏
  • 举报
回复
<html>
<head>

<script LANGUAGE="VBScript" RUNAT="Server">
<!--
option explicit
-->
</script>
<title>Advanced Index Server Search Form</title>
<link REL="STYLESHEET" HREF="is2style.css" TYPE="text/css">
<meta NAME="DESCRIPTION" CONTENT="Sample query form for Microsoft Index Server">
<meta NAME="AUTHOR" CONTENT="Index Server Team">
<meta NAME="KEYWORDS" CONTENT="query, content, hit">
<meta NAME="SUBJECT" CONTENT="sample form">
<meta NAME="MS.CATEGORY" CONTENT="Internet">
<meta NAME="MS.LOCALE" CONTENT="ZH-CN">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=GB2312">
<%
DebugFlag = FALSE
NewQuery = FALSE
UseSavedQuery = FALSE
SearchString = ""
Scope="/"
Doctype=""
QueryForm = Request.ServerVariables("PATH_INFO")

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
SearchString = Request.Form("SearchString")
DocAuthorRestriction = Request.Form("DocAuthorRestriction")
FSRest = Request.Form("FSRest")
FSRestVal = Request.Form("FSRestVal")
FSRestOther = Request.Form("FSRestOther")
FMMod = Request.Form("FMMod")
FMModDate = Request.Form("FMModDate")
SortBy = Request.Form("SortBy")
Colset = Request.Form("ColChoice")
Doctype = Request.Form("Doctype")
Scope = Request.Form("Scope")
RankBase = Request.Form("RankBase")
' NOTE: this will be true only if the button is actually pushed.
if Request.Form("Action") = "执行" then
NewQuery = TRUE
elseif Request.Form("pg") <> "" then
UseSavedQuery=TRUE
NextPageNumber = Request.Form("pg")
end if
end if
%>
<style>
.fontstyle{font-size:9pt}
</style>

</head>

<body topmargin="0" leftmargin="0" background="is2bkgnd.gif" OnLoad="SetAll()" LANGUAGE="JavaScript">

<table>
<tr><td><a HREF="http://web_server" target="_top"><img SRC="title.gif" border="0" VALIGN="MIDDLE" ALIGN="LEFT" WIDTH="227" HEIGHT="80"></a></td></tr>
<tr><td ALIGN="RIGHT"><h3>TQNPC全文检索</h3></td></tr>
</table>
<hr>
<script LANGUAGE="JavaScript">
<!--
function SetAll()
{
document.QForm.SearchString.value = "<%=SearchString%>";
document.QForm.Scope.value = "<%=Scope%>";
document.QForm.Doctype.value = "<%=Doctype%>";

<%select case FSRest%>
<%case " > "%>
document.QForm.FSRest.selectedIndex = 1;
<%case else%>
document.QForm.FSRest.selectedIndex = 0;
<%end select%>

<%select case FSRestVal%>
<%case "any"%>
document.QForm.FSRestVal.selectedIndex = 0;
<%case "100"%>
document.QForm.FSRestVal.selectedIndex = 1;
<%case "1024"%>
document.QForm.FSRestVal.selectedIndex = 2;
<%case "10240"%>
document.QForm.FSRestVal.selectedIndex = 3;
<%case "102400"%>
document.QForm.FSRestVal.selectedIndex = 4;
<%case "1048576"%>
document.QForm.FSRestVal.selectedIndex = 5;
<%case "10485760"%>
document.QForm.FSRestVal.selectedIndex = 6;
<%case "104857600"%>
document.QForm.FSRestVal.selectedIndex = 7;
<%case "other"%>
document.QForm.FSRestVal.selectedIndex = 8;
<%case else%>
document.QForm.FSRestVal.selectedIndex = 0;
<%end select%>

document.QForm.FSRestOther.value = "<%=FSRestOther%>";

<%select case FMMod%>
<%case "any"%>
document.QForm.FMMod.selectedIndex = 0;
<%case "-10n"%>
document.QForm.FMMod.selectedIndex = 1;
<%case "-1h"%>
document.QForm.FMMod.selectedIndex = 2;
<%case "-1d"%>
document.QForm.FMMod.selectedIndex = 3;
<%case "-1w"%>
document.QForm.FMMod.selectedIndex = 4;
<%case "-1m"%>
document.QForm.FMMod.selectedIndex = 5;
<%case "-1y"%>
document.QForm.FMMod.selectedIndex = 6;
<%case "since"%>
document.QForm.FMMod.selectedIndex = 7;
<%case else%>
document.QForm.FMMod.selectedIndex = 0;
<%end select%>

document.QForm.FMModDate.value = "<%=FMModDate%>";

document.QForm.DocAuthorRestriction.value = "<%=DocAuthorRestriction%>";
}
//-->
</script>

<center>
<form NAME="QForm" ACTION="<%=QueryForm%>" METHOD="POST">
<table width="500" style="font-size:9pt">

<tr>
<td align="right" colspan="2">输入查询条件:
<input class="fontstyle" TYPE="TEXT" NAME="SearchString" SIZE="27" MAXLENGTH="100" VALUE></td>
</tr>

<tr>
<td align="right" colspan="2">文档作者:
<input class="fontstyle" TYPE="TEXT" NAME="DocAuthorRestriction" SIZE="27" MAXLENGTH="100" VALUE>
<td>
</tr>

<tr>
<td align="right" colspan="2">文件类型:
<select NAME="Doctype" class="fontstyle">
<option VALUE="" SELECTED>所有文件
<option VALUE=".doc">Word文件
<option VALUE=".xls">Excel文件
<option VALUE=".ppt">幻灯片
<option VALUE=".txt">文本文件
<option VALUE=".jpg">图片
<option VALUE=".pdf">PDF文件
</select>
<td>
</tr>


<tr>
<td align="right" colspan="2">选择部门:
<select class="fontstyle" NAME="Scope">
<option VALUE="/" SELECTED>所有部门
<option VALUE="/tqnpc/公司办">公司办公室
<option VALUE="/tqnpc/工程计划处">工程计划处
<option VALUE="/tqnpc/工程管理处">工程管理处
<option VALUE="/tqnpc/质量保证处">质量保证处
<option VALUE="/tqnpc/合同处">合同管理处
<option VALUE="/tqnpc/设计管理处">设计管理处
<option VALUE="/tqnpc/设备管理处">设备管理处
<option VALUE="/tqnpc/文件档案处">文件档案处
<option VALUE="/tqnpc/财务处">财务处
<option VALUE="/tqnpc/审计处">审计处
<option VALUE="/tqnpc/劳动人事处">劳动人事处
<option VALUE="/tqnpc/政工处">政工处
<option VALUE="/tqnpc/枫叶村办公室">枫叶村办公室
<option VALUE="/tqnpc/调试.生产处">调试、生产准备处
</select>

<td>
</tr>

<tr>
<td align="right" colspan="2">文件大小: <select class="fontstyle" NAME="FSRest">
<!-- <OPTION VALUE=" < " <%if FSRest = " < " then%>SELECTED <%end if%>>Less Than <OPTION VALUE=" > " <%if FSRest = " > " then%>SELECTED <%end if%>>大于 -->
<option VALUE=" < " SELECTED>小于
<option VALUE=" > ">大于
</select>

<select class="fontstyle" NAME="FSRestVal">
<option VALUE="any" SELECTED>任意大小
<option VALUE="100">100 字节
<option VALUE="1024">1K 字节
<option VALUE="10240">10K 字节
<option VALUE="102400">100K 字节
<option VALUE="1048576">1M 字节
<option VALUE="10485760">10M 字节
<option VALUE="104857600">100M 字节
<option VALUE="other">其他
</select>

<input class="fontstyle" TYPE="TEXT" NAME="FSRestOther" SIZE="12" MAXLENGTH="9" VALUE>
</td>
</tr>

<tr>
<td align="right" colspan="2">修改时间:
<select class="fontstyle" NAME="FMMod">
<option VALUE="any" SELECTED>任意时间。
<option VALUE="-10n">最近十分钟内。
<option VALUE="-1h">最近一小时内。
<option VALUE="-1d">最近一天内。
<option VALUE="-1w">最近一周内。
<option VALUE="-1m">最近一月内。
<option VALUE="-1y">最近一年内。
<option VALUE="since">从 GMT (yy/mm/dd) 以后。
</select>
<input class="fontstyle" TYPE="TEXT" NAME="FMModDate" SIZE="12" MAXLENGTH="9" VALUE>
</td>
</tr>

<tr>
<td align="right" colspan="2"><a HREF="ixtiphlp.htm">搜索提示</a>
<input class="fontstyle" TYPE="SUBMIT" NAME="Action" VALUE="执行">
<input class="fontstyle" TYPE="RESET" NAME="Clear" VALUE="清除">
</td>
</tr>
</table>

<input TYPE="HIDDEN" NAME="SortBy" VALUE="rank[d]">
<input TYPE="HIDDEN" NAME="ColChoice" VALUE="1">
<!-- <input TYPE="HIDDEN" NAME="Scope" VALUE="/tqnpc/文件档案处">-->

</form>
<br>

<%if DebugFlag then%>
<pre>
SearchString = <%=SearchString%>
DocAuthorRestriction = <%=DocAuthorRestriction%>
FSRest = <%=FSRest%>
FSRestVal = <%=FSRestVal%>
FSRestOther = <%=FSRestOther%>
FMMod = <%=FMMod%>
FMModDate = <%=FMModDate%>
SortBy = <%=SortBy%>
Colset = <%=Colset%>
Scope = <%=Scope%>
NewQuery = <%=CStr(NewQuery)%>
UseSavedQuery = <%=CStr(UseSavedQuery)%>
</pre>
<%end if%>

<%
if NewQuery then
set Session("Query") = nothing
set Session("Recordset") = nothing
NextRecordNumber = 1
set Q = Server.CreateObject("ixsso.Query")

Composer = ""
TheQuery = ""

if SearchString <> "" then
if Left( SearchSting, 1 ) <> "@" AND Left( SearchString, 1 ) <> "#" AND Left( SearchString, 1 ) <> "$" then
TheQuery = "(@Contents " + SearchString + ") "
else
TheQuery = "(" + SearchString + ") "
end if

Composer = " & "
end if

if FSRestVal <> "any" then
if FSRestVal <> "other" then
TheQuery = "(@Size " + FSRest + FSRestVal + ") " + Composer + TheQuery
else
TheQuery = "(@Size " + FSRest + FSRestOther + ") " + Composer + TheQuery
end if

Composer = " & "
end if

if Doctype <> "" then
TheQuery = "(@filename " + Doctype + ") " + Composer + TheQuery

Composer = " & "
end if

if DocAuthorRestriction <> "" then
TheQuery = "(@DocAuthor " + DocAuthorRestriction + ") " + Composer + TheQuery

Composer = " & "
end if

if FMMod <> "" AND FMMod <> "any" then
if FMMod <> "since" then
TheQuery = "(@Write > " + FMMod + ") " + Composer + TheQuery
else
TheQuery = "(@Write > " + FMModDate + ") " + Composer + TheQuery
end if
end if

Composer = " & "
if TheQuery="" then TheQuery="(@Size > 0)" end if

%> <%if DebugFlag then%> TheQuery = <%=TheQuery%> <%end if%> <%

Q.Query = TheQuery

Q.SortBy = SortBy
if Scope <> "/" then
set Util = Server.CreateObject("ixsso.Util")
Util.AddScopeToQuery Q, Scope, "DEEP"
set Util = nothing
end if
if ColSet = 1 then
Q.Columns = "DocTitle, vpath, path, filename, size, write, characterization, rank"
RecordsPerPage = 10
elseif ColSet = 2 then
Q.Columns = "vpath, path"
RecordsPerPage = 200
elseif ColSet = 3 then
Q.Columns = "filename, vpath, size, write"
RecordsPerPage = 25
end if

set RS = Q.CreateRecordSet("nonsequential")
RS.PageSize = RecordsPerPage
ActiveQuery = TRUE
elseif UseSavedQuery then
if IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) then
set Q = Session("Query")
set RS = Session("RecordSet")
if RS.RecordCount <> -1 and NextPageNumber <> -1 then
RS.AbsolutePage = NextPageNumber
NextRecordNumber = RS.AbsolutePosition
end if
ActiveQuery = TRUE
else
Response.Write "出错 - 未保存查询"
end if
end if

if ActiveQuery then
if not RS.EOF then
%>

<p>
<hr WIDTH="100%" ALIGN="center" SIZE="3">
<p>

<%
LastRecordOnPage = NextRecordNumber + RS.PageSize - 1
CurrentPage = RS.AbsolutePage
if RS.RecordCount <> -1 AND RS.RecordCount < LastRecordOnPage then
LastRecordOnPage = RS.RecordCount
end if

Response.Write "文档 " & NextRecordNumber & " 到 " & LastRecordOnPage
if RS.RecordCount <> -1 then
Response.Write "(共 " & RS.RecordCount & " )"
end if

if SearchString <> "" then
Response.Write "符合查询“<B>"
Response.Write SearchString & "</B>”。<P>"
end if
%>
</pre>

<table border="0">
<colgroup width="105">
<% Do While Not RS.EOF and NextRecordNumber <= LastRecordOnPage

' This is the detail portion for Title, Abstract, URL, Size, and
' Modification Date.
' If there is a title, display it, otherwise display the filename.
' Graphically indicate rank of document with list of stars (*'s).

if NextRecordNumber = 1 then
RankBase=RS("rank")

if RankBase>1000 then
RankBase=1000
elseif RankBase<1 then
RankBase=1
end if
end if

NormRank = RS("rank")/RankBase

if NormRank > 0.80 then
stars = "rankbtn5.gif"
elseif NormRank > 0.60 then
stars = "rankbtn4.gif"
elseif NormRank > 0.40 then
stars = "rankbtn3.gif"
elseif NormRank >.20 then
stars = "rankbtn2.gif"
else stars = "rankbtn1.gif"

end if

%>

<tr class="RecordTitle">
<td align="right" valign="top" class="RecordTitle">
<%= NextRecordNumber%>.
</td>
<td><b class="RecordTitle">
<%if VarType(RS("DocTitle")) = 1 or RS("DocTitle") = "" then%>
<a href="<%=RS("vpath")%>" class="RecordTitle"><%= Server.HTMLEncode( RS("filename") )%></a>
<%else%>
<a href="<%=RS("vpath")%>" class="RecordTitle"><%= Server.HTMLEncode(RS("DocTitle"))%></a>
<%end if%>
</b></td>
</tr>
<tr>
<td valign="top" align="left">
<img SRC="<%=stars%>">
<br>
<%
' Construct the URL for hit highlighting
WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( RS("vpath") )
WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( Q.Query )
WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "<b class=Hit>" )
WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "</b>" )
WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm
' WebHitsQuery = WebHitsQuery & "&CiLocale=" & Q.LocaleID
%>
<a href="oop/qsumrhit.htw?<%= WebHitsQuery %>"><img src="hilight.gif" align="left" alt="用摘要模式加亮显示文档中匹配的词条。" WIDTH="22" HEIGHT="22">摘要</a>
<br>
<a href="oop/qfullhit.htw?<%= WebHitsQuery %>&CiHiliteType=Full"><img src="hilight.gif" align="left" alt="加亮显示文档中匹配的词条。" WIDTH="22" HEIGHT="22">完全</a>
</td>
<td valign="top">
<%if VarType(RS("characterization")) = 8 and RS("characterization") <> "" then%>
<b><i>摘要:</i></b><%= Server.HTMLEncode(RS("characterization"))%>
<%end if%>
<p>
<i class="RecordStats"><a href="<%=RS("vpath")%>" class="RecordStats" style="color:blue;">http://<%=Request("server_name")%><%=RS("vpath")%></a>
<br><%if RS("size") = "" then%>(大小和时间未知)<%else%>大小 <%=RS("size")%> 字节 - <%=RS("write")%> GMT<%end if%></i>
</td>
</tr>
<tr></tr>
<%
RS.MoveNext
NextRecordNumber = NextRecordNumber+1
Loop
%>

</table>

<p><br>

<%
else ' NOT RS.EOF
if NextRecordNumber = 1 then
Response.Write "无文档匹配查询<P>"
else
Response.Write "查询中没有更多文档<P>"
end if

end if ' NOT RS.EOF
%>

<!-- If the index is out of date, display the fact -->

<%if NOT Q.OutOfDate then%>
<p>
<i>索引是最新的。</i><br>
<%end if%>

<!-- If the query was not executed because it needed to enumerate to resolve the query instead of using the index, but AllowEnumeration was FALSE, let the user know-->

<%if Q.QueryIncomplete then%>
<p>
<i><b>查询花费太高,无法完成。</b></i><br>
<%end if%>

<!-- If the query took too long to execute (for example, if too much work was required to resolve the query), let the user know-->

<%if Q.QueryTimedOut then%>
<p>
<i><b>查询太长,无法完成。</b></i><br>
<%end if%>


<table>

<!-- This is the "previous" button. This retrieves the previous page of documents for the query.-->

<%SaveQuery = FALSE%>
<%if CurrentPage > 1 and RS.RecordCount <> -1 then ' BUGBUG - use RS.Supports(adMovePrevious)%>
<td align="left">
<form action="<%=QueryForm%>" method="post">
<input TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
<input TYPE="HIDDEN" NAME="DocAuthorRestriction" VALUE="<%=DocAuthorRestriction%>">
<input TYPE="HIDDEN" NAME="FSRest" VALUE="<%=FSRest%>">
<input TYPE="HIDDEN" NAME="FSRestVal" VALUE="<%=FSRestVal%>">
<input TYPE="HIDDEN" NAME="FSRestOther" VALUE="<%=FSRestOther%>">
<input TYPE="HIDDEN" NAME="FMMod" VALUE="<%=FMMod%>">
<input TYPE="HIDDEN" NAME="FMModDate" VALUE="<%=FMModDate%>">
<input TYPE="HIDDEN" NAME="SortBy" VALUE="<%=SortBy%>">
<input TYPE="HIDDEN" NAME="Colset" VALUE="<%=ColChoice%>">
<input TYPE="HIDDEN" NAME="Scope" VALUE="<%=Scope%>">
<input TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage-1%>">
<input TYPE="HIDDEN" NAME="RankBase" VALUE="<%=RankBase%>">

<input type="submit" value="前 <%=RS.PageSize%> 个文档">
</form>
</td>
<%SaveQuery = TRUE%>
<%end if%>

<!-- This is the "next" button. This button retrieves the next page of documents for the query.-->

<%if Not RS.EOF then%>
<td align="right">
<form action="<%=QueryForm%>" method="post">

<input TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
<input TYPE="HIDDEN" NAME="DocAuthorRestriction" VALUE="<%=DocAuthorRestriction%>">
<input TYPE="HIDDEN" NAME="FSRest" VALUE="<%=FSRest%>">
<input TYPE="HIDDEN" NAME="FSRestVal" VALUE="<%=FSRestVal%>">
<input TYPE="HIDDEN" NAME="FSRestOther" VALUE="<%=FSRestOther%>">
<input TYPE="HIDDEN" NAME="FMMod" VALUE="<%=FMMod%>">
<input TYPE="HIDDEN" NAME="FMModDate" VALUE="<%=FMModDate%>">
<input TYPE="HIDDEN" NAME="SortBy" VALUE="<%=SortBy%>">
<input TYPE="HIDDEN" NAME="Colset" VALUE="<%=ColChoice%>">
<input TYPE="HIDDEN" NAME="Scope" VALUE="<%=Scope%>">
<input TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage+1%>">
<input TYPE="HIDDEN" NAME="RankBase" VALUE="<%=RankBase%>">

<% NextString = "后 "
if RS.RecordCount <> -1 then
NextSet = (RS.RecordCount - NextRecordNumber) + 1
if NextSet > RS.PageSize then
NextSet = RS.PageSize
end if
NextString = NextString & NextSet & " 个文档"
else
NextString = NextString & " 页"
end if
%>
<input type="submit" value="<%=NextString%>">
</form>
</td>
<%SaveQuery = TRUE%>
<%end if%>

</table>


<!-- Display the page number -->

页码 <%=CurrentPage%>
<%if RS.PageCount <> -1 then
Response.Write "(共 " & RS.PageCount & " 页)"
end if %>

<%
' If either of the previous or back buttons were displayed, save the query
' and the recordset in session variables.
if SaveQuery then
set Session("Query") = Q
set Session("RecordSet") = RS
else
RS.close
Set RS = Nothing
Set Q = Nothing
set Session("Query") = Nothing
set Session("RecordSet") = Nothing
end if
%>
<% end if %>

</center>

<!--#include file ="is2foot.inc"-->

</body>
</html>
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧