-
Notifications
You must be signed in to change notification settings - Fork 54
GetSearchResult()接口参数说明
lunvo edited this page Sep 27, 2018
·
1 revision
在统计方案中,使用DigitalPlatform.LibraryClient.LibraryChannel类的GetSearchResult()函数。
// 获得检索命中的结果集信息
// parameters:
// strResultSetName 结果集名。如果为空,表示使用当前缺省结果集"default"
// lStart 要获取的开始位置。从0开始计数
// lCount 要获取的个数
// strBrowseInfoStyle 所返回的SearchResult中包含哪些信息。为逗号分隔的字符串列表值,取值可为 id/cols 之一。例如,"id,cols"表示同时获取id和浏览信息各列,而"id"表示仅取得id列。
// strLang 语言代码。一般为"zh"
// searchresults 返回包含记录信息的SearchResult对象数组
// rights:
// 没有限制
// return:
// -1 出错
// >=0 结果集内记录的总数(注意,并不是本批返回的记录数)
public long GetSearchResult(
DigitalPlatform.Stop stop,
string strResultSetName,
long lStart,
long lCount,
string strBrowseInfoStyle,
string strLang,
out SearchResult[] searchresults,
out string strError)
参数说明请参考 参考手册第3.12节GetSearchResult()
该示例是在一个框架统计方案中,获取一个结果集内信息的写法。
LibraryChannel channel = this.MainForm.GetChannel();
try
{
Record[] results = null;
lRet = channel.GetSearchResult(null,
"readers", //结果集名
0, //要获取的起点位置。从0开始计数
1, //要获取的元素个数
"xml,timestamp,id", //获取方式
"zh", //语言代码
out results, //返回的检索结果事项数组
out strError);
if (lRet == -1) //出错
{
MessageBox.Show(strError);
return;
}
else if (lRet == 0) //>=0: 结果集内记录的总数(注意,并不是本批返回的记录数)
{
// TODO: 未能获得到检索结果
continue;
}
else if (lRet > 1)
{
// TODO: 不应该出现这种情况
continue;
}
finally
{
this.MainForm.ReturnChannel(channel);
}
继续卖力的生长吧 / 离参天还很远呢 / 继续飞快的发芽吧 / 要遮天蔽日还要许久呢