简体   繁体   中英

How to search Folder with luceneSearch in Alfresco

I have tried to search a folder with a Lucene search script, but my link doesn't work, can someone help me please, this is my code.

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

}

You can try this query:

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

And make sure you have created this web-script in alfresco.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM