我尝试使用Lucene搜索脚本搜索文件夹,但我的链接不起作用,有人可以帮助我,这是我的代码。
var folderNode = search.luceneSearch(PATH:"/app:company_home/* " AND +@cm\:name:args.folderName AND TYPE:"cm:folder"); //don't work
if(folderNode.length == 1){
folderNode[0].setPermission("Contributor", "admin");
folderNode[0].setPermission("Contributor", "Developpers");
model.myStatus = "Permission was set successfully!";
} else if (folderNode.length == 0){
model.myStatus = "Folder not found";
} else {
model.myStatus = "Duplicate folder found";
}
答案 0 :(得分:0)
您可以尝试此查询:
var folderNode = search.luceneSearch("PATH:\"/app:company_home/cm:**HereYourFolderName**\" AND TYPE:\"cm:folder\"");
并确保您已在露天创建此网络脚本。