AnsweredAssumed Answered

Problem with search.luceneSearch

Question asked by vja on Jun 16, 2008
Hi,

hopefully someone can help us on this.

Brief introduction:
We have created the following ascpect which has a property with constraints. Everything works as expected.


<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>
<model name="publish:publishmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Publish Model</description>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>  
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="extension.publish" prefix="publish"/>
   </namespaces>
 
   <constraints>
      <constraint name="publish:publishFoldersList" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>TEXT_A</value>
               <value>TEXT_B</value>
               <value>TEXT_C</value>
            </list>
         </parameter>
      </constraint>
   </constraints>
 
   <aspects>     
      <!– Definition of new publishable Aspect –>
      <aspect name="publish:publishable">
         <title>Publishable</title>
         <properties>
            <property name="publish:folders">
               <title>Publish folders</title>
                 <type>d:text</type>
                 <multiple>true</multiple>
               <index enabled="true">
                  <atomic>true</atomic>
                  <stored>true</stored>
                  <tokenised>true</tokenised>
               </index>                 
               <constraints>
                  <constraint ref="publish:publishFoldersList" />
               </constraints>
              </property>
         </properties>
      </aspect>
   </aspects>
</model>

Using this aspect we are able to add one of the list entries (TEXT_A, …) to a space or content.

The Problem:
The goal is to search for all entries (via web scripts) that are assigned to a specific list entry (e.g. TEXT_A).

The following search term works for the lucene search within the node browser.


+@\{extension.publish\}folders:TEXT_A

We have tried to run it in a web script (java script) as the following:


var nodes = search.luceneSearch("\"+@\\{extension.publish\\}folders:TEXT_A\"");

Of course we have tried it with several modifications of the search term. Nothing return the respective nodes as the search in the node browser.

Hoping for help  :wink:

Outcomes