cancel
Showing results for 
Search instead for 
Did you mean: 

Search all a space and all children

mliedtke
Champ in-the-making
Champ in-the-making
Hi All,
I'm working on a webscript that allows a user to search a current space.  I have it working that it searches the current space for the query string, but I can't get it to recursively look at the current space and all child spaces.

My current script looks like this

<#assign currentNodeId = args.h>
<#assign currentNode = companyhome.nodeByReference[currentNodeId]>

<#assign searchString = args.s>
<#if (searchString == "")>
   <#assign results = currentNode.children?sort_by('name') >
<#else>
   <#assign queryString = "(PATH:\"${currentNode.qnamePath}/*\") AND ((TEXT:\"${searchString}\") OR (@cm\\:name:*${searchString}*))" >
   <BR>${queryString}
   <#assign results = companyhome.childrenByLuceneSearch[queryString] >
</#if>

The output of the queryString produces this:
(PATH:"/app:company_home/cm:Community_x0020_Spaces/cm:Intranet_x0020_Forms/*") AND ((TEXT:"time") OR (@cm\:name:*time*))

This works fine for searching the given folder, but not the given folder, and all subfolders and so on down the line.

Is there a way I can get that to work?

Thanks,
Mark
2 REPLIES 2

tommorris
Champ in-the-making
Champ in-the-making
Have you tried searching with the double oblique?
Something like this: +PATH:"/dirA/dirB//*"

Tom

mliedtke
Champ in-the-making
Champ in-the-making
Tom,
That did it!
Thanks so much for your help