指定升序排序时,vw.FTSearchSorted失败

时间:2014-12-06 22:41:24

标签: xpages xpages-ssjs

我有一个FTSearchSorted问题

我在某些SSJS中的代码如下所示:

var vw:NotesView = thisAppDB.getView("vwFTSearch")
var n:Integer = vw.FTSearchSorted(qString, 0 , "SortBy" , false, false, false  );

我收到以下错误

AfterPageLoad响应MYActionView方法NotesView.FTSearchSorted(字符串,数字,字符串,布尔值,布尔值,布尔值)未找到,或非法参数

如果我将代码更改为:

var vw:NotesView = thisAppDB.getView("vwFTSearch")
var n:Integer = vw.FTSearchSorted(qString, 0 , "SortBy"   );

它运行没有错误。视图vwFTSearch中的第一列是Sorted,并设置为Click on Header to Sort = Both。如果我在Notes客户端中打开视图,我可以单击标题并正确排序。这将返回默认排序为Ascending的文档,但我希望它按Descending排序。当然看起来它应该工作。尝试重建视图索引。

1 个答案:

答案 0 :(得分:4)

向FTSearchSorted:

添加第七个参数fuzzy:boolean
var n:Integer = vw.FTSearchSorted(qString, 0 , "SortBy" , false, false, false, false);

您的FTSearchSorted调用必须与以下参数版本之一匹配:

FTSearchSorted(query:string) : int
FTSearchSorted(query:string, maxdocs:int) : int    
FTSearchSorted(query:string, maxdocs:int, column:string) : int
FTSearchSorted(query:string, maxdocs:int, column:string, ascending:boolean, exact:boolean, variants:boolean, fuzzy:boolean) : int
FTSearchSorted(query:string, maxdocs:int, column:int) : int
FTSearchSorted(query:string, maxdocs:int, column:int, ascending:boolean, exact:boolean, variants:boolean, fuzzy:boolean) : int
FTSearchSorted(query:java.util.Vector) : int
FTSearchSorted(query:java.util.Vector, maxdocs:int) : int
FTSearchSorted(query:java.util.Vector, maxdocs:int, column:string) : int
FTSearchSorted(query:java.util.Vector, maxdocs:int, column:string, ascending:boolean, exact:boolean, variants:boolean, fuzzy:boolean) : int
FTSearchSorted(query:java.util.Vector, maxdocs:int, column:int) : int
FTSearchSorted(query:java.util.Vector, maxdocs:int, column:int, ascending:boolean, exact:boolean, variants:boolean, fuzzy:boolean) : int

您可以使用示例here找到FTSearchSorted的完整说明。