如何用ASP建立Index Server查询对象并为其参数赋值?

栏目: 编程语言 · 发布时间: 8年前

内容简介:如何用ASP建立Index Server查询对象并为其参数赋值?

一个方法是利用Index Server query object和参数:

<%
Set Q= Sever.CreatObject("ixsso.Query")     

' 创建查询对象.
Set Util= Sever.CreatObject("ixsso.Util")
Q.Query= Request("SearchString")        

' 查询字段.
Q.SortBy="rank[d] "       

' 按照符合程度降序排列
Q.Columns="Doctitle,vpath,filename,size,write,characterization,rank"
' 返回记录属性.
Q.MaxRecords=300    

' 最多返回记录数.
Util.AddScopeToQuery Q, "/","DEEP"    

' 搜索所有子目录.
Q.LocaleID=Util.ISOToLocaleID(
“ZH-CN”)      

' 指定所用语言为简体中文.
Set RS = Q.CreateRecordSet("nonsequential")     

' 创建输出集.
%>

 

另一个方法就是.利用ADO query object和SQL语句:

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString =  "provider=msidxs;"
Conn.Open
Set AdoCommand = Server.CreateObject("ADODB.Command")
Set AdoCommand.ActiveConnection = Conn
AdoCommand.CommandText = "Select Doctitle,vpath,filename,size,write, "&"characterization,rank from  SCOPE() WHERE CONTAINS (` "&SearchString &"`) ORDER BY rank DESC"
Set RS = Server.CreateObject("ADODB.RecordSet")
RS.open AdoCommand
%>


以上所述就是小编给大家介绍的《如何用ASP建立Index Server查询对象并为其参数赋值?》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

Algorithms

Algorithms

Robert Sedgewick、Kevin Wayne / Addison-Wesley Professional / 2011-3-19 / USD 89.99

Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewick,s best-selling series, reflecting an indispensable body of knowledge developed over the ......一起来看看 《Algorithms》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

SHA 加密
SHA 加密

SHA 加密工具

html转js在线工具
html转js在线工具

html转js在线工具