cancel
Showing results for 
Search instead for 
Did you mean: 

Search in WebScript

emmy
Champ in-the-making
Champ in-the-making
Hi,
I want create a web script that search all the nodes starting from a defined node optained from the args of the script.
I can retrieve the node, but I can't use its displayPath property in the lucene search. I saw that there's also a path property but its value is undefined.


if ((args.rootId != null) && (args.rootId != "")) {
   model.root = search.findNode("workspace://SpacesStore/" + args.rootId);
} else {
   model.root = roothome;
}

var path = ???;

var queryString = "PATH:\"//" + path + "//*\" AND (TYPE:\"{http://www.alfresco.org/model/content/1.0}content\" OR TYPE:\"{http://www.alfresco.org/model/content/1.0}folder\")";

model.results = search.luceneSearch(queryString);

Thanks,
Emanuela
2 REPLIES 2

davidc
Star Contributor
Star Contributor
Looks like you can't get the (qname) path of a node for use in lucene searches.

I failed to find a workaround, so I think we'll need to add a method to Javascript API.

davidc
Star Contributor
Star Contributor
Alternatively, there is a getQnamePath() available in freemarker.  So you could do the search there instead of javascript.