如何在 Alfresco 中使用 luceneSearch 搜索文件夹

How to search Folder with luceneSearch in Alfresco

我尝试使用 Lucene 搜索脚本搜索文件夹,但我的 link 不起作用,有人可以帮助我吗,这是我的代码。

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";

}

您可以试试这个查询:

var folderNode =  search.luceneSearch("PATH:\"/app:company_home/cm:**HereYourFolderName**\" AND TYPE:\"cm:folder\"");

并确保您已在露天创建此网络脚本。