AnsweredAssumed Answered

Search all a space and all children

Question asked by mliedtke on Sep 17, 2008
Latest reply on Sep 18, 2008 by mliedtke
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

Outcomes