Skip to content

Instantly share code, notes, and snippets.

@billerby
Created December 18, 2017 12:22
Show Gist options
  • Save billerby/7bab5fd88c0e79340af969b0f83dc7f4 to your computer and use it in GitHub Desktop.
Save billerby/7bab5fd88c0e79340af969b0f83dc7f4 to your computer and use it in GitHub Desktop.
var siteQuery = 'TYPE:"st:site"';
var nodes = search.query({
query: siteQuery,
language: 'FTS-ALFRESCO'
});
var filterQueryDefault = "";
var pathFilter = [];
for each(var node in nodes) {
if (node.properties["st:sitePreset"] == 'hse-site'){
pathFilter.push(' PATH:"' + node.qnamePath + '//."');
}
}
filterQueryDefault = "query " + " +( " + pathFilter.join(" OR ") + " ) ";
print(filterQueryDefault);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment