AnsweredAssumed Answered

Freemarker Lucene Search node context

Question asked by rhofkens on Jan 12, 2007
Latest reply on Jan 25, 2007 by kevinr
Hello,

I'm building a template that lists all nodes of type cm:content in a space (and its subspaces).  The template looks like this

<#assign query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"" />
<#assign rowcount=0>
<table>
   <tr style='background-color: #C6D8EB'>
      <td></td>
      <td><b>Document name</b></td>
      <td><b>Document creation date</b></td>
      <td><b>Document creator</b></td>
      <td><b>Document modification date</b></td>
      <td><b>Document modifier</b></td>
   </tr>
   <#list space.childrenByLuceneSearch[query] as child>
     <#if rowcount % 2 = 0><tr><#else><tr style='background-color: #DEE5EC'></#if>
       <td><a href="/alfresco${child.url}" target="new"><img src="/alfresco${child.icon16}" border=0></td>
       <td><a href="/alfresco${child.url}" target="new">${child.properties.name}</a></td>
       <td>${child.properties.created?date}<td>
       <td>${child.properties.creator}<td>
       <td>${child.properties.modified?date}<td>
       <td>${child.properties.modifier}<td>      
    </tr>
    <#assign rowcount=rowcount+1>
   </#list>
</table>

The search results list however, includes nodes from the complete repo.  I would like limit the search scope to the current space (and subspaces), that's why I uses space.childrenByLuceneQuery.  Is this possible?

best regards,
Roeland.

Outcomes