AnsweredAssumed Answered

Searching based on the folder name

Question asked by patorjk on Jul 6, 2011
Latest reply on Jul 7, 2011 by patorjk
How would I search based on folder name? I'm creating a dashlet that allows the user to search for folders. I've got a Share dashlet setup that's talking to an Alfresco web script, but my issue is that in the Alfresco web script, I'm not sure how to search just for folders. I've found I can search the path:

var node,
    item,
    results,
    items = [];

results = search.query({query: "PATH:*alfresco*"});

for (var ii = 0; ii < results.length; ii++) {

    node = results[ii];
   
    item = {
        nodeRef:        node.nodeRef.toString(),
        type:           node.typeShort,
        name:           node.name,
        title:          node.properties["cm:title"],
        description:    node.properties["cm:description"]
    };

    items.push(item);
}

model.items = items;

Though that brings up much more than what I want. How would one construct a query to search for folders based on their name?

thanks,

- Pat

Outcomes