cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to have Associations in Advanced Search?

vicsaego
Champ in-the-making
Champ in-the-making
Hi everyone,

I've created custom properties en stContext.xml like this:

       <type name="stSmiley Surprisedffert">
         <title>esistel</title>
         <parent>cm:content</parent>
         <properties>         
             <property name="st:codOffert">
               <type>d:text</type>
            </property>
        </properties>   
           <associations>
            <association name="st:associatedOfferts">           
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>              
               <target>
                  <class>stSmiley Surprisedffert</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>              
            </association>
          
         </associations>

and I would like to have this associations in advanced search. Mi objetive is to have the possibility to find a document searching by associated offerts? For example, a document has a code (codOffert) of OE_321, but this document may be associated with one, two o more documents having codes like OE_567, OE603, OE_647. Is it possible to search this document whith codOffert OE_321?  Of course, when a user upload a document introduces a list of codes of documents which the original document is associated whith.

I have tried to do this with this piece of code in web-client-config-custom.xml:

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>           
            <type name="stSmiley Surprisedffert" />
         </content-types>
         <custom-properties> 
            <!–<meta-data type="stSmiley Surprisedffert" property="st:associatedOfferts" display-label="idAssociated" /> –>
            <show-association name="st:associatedOfferts" display-label="idAssociated" />
         </custom-properties>
      </advanced-search>
   </config>

Thansk very much in advance.
1 REPLY 1

pmonks
Star Contributor
Star Contributor
I could be wrong on this, but I don't believe associations can be searched since they're not indexable into Lucene (so even if you could get them to show up on the advanced search page, users still wouldn't be able to search by them).  You might be able to use a property of type NodeRef instead (since I believe NodeRefs can be indexed), although the default property sheet widget for NodeRefs is different than it is for associations.

Hopefully someone a bit more knowledgeable than I can chime in and set us both straight.  :wink:

Cheers,
Peter