cancel
Showing results for 
Search instead for 
Did you mean: 

advanced search Alfresco Share

domilingos
Champ in-the-making
Champ in-the-making
Hello everyone,
I use Alfresco community 3.4c. My problem is to try using the advanced search alfresco share an association declared in my content model. I can see the associations in both the entry form in which to edit. Also view the field of the association in the search form, I can select it but when you get the results did not find anything. Has anyone already faced this problem?
Thanks
5 REPLIES 5

openpj
Elite Collaborator
Elite Collaborator
Can you share with us your configuration?

domilingos
Champ in-the-making
Champ in-the-making

<model name="pref:mymodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>mysite</description>
    <author></author>
    <version>1.0</version>
    <imports>
       <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"></import>
       <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"></import>
    </imports>
    <namespaces>
   <namespace uri="myuri" prefix="pref"></namespace>
    </namespaces>
    <types>
   <type name="pref:type1">
      <title>typee1</title>
      <parent>cm:folder</parent>
      <properties>
                   <property name="pref:name">
                   <title>name</title>
                   <type>d:text</type>
                </property>
                <associations>
          <association name="pref:assoc1">
           <title>ass1</title>
            <source>
                                   <mandatory>true</mandatory>
                                   <many>true</many> 
                                </source>
                                <target>
               <class>cm:person</class>
               <mandatory>true</mandatory>
               <many>true</many>
            </target>
                 </association>
           <association name="pref:assoc2">
                        <title>ass2</title>
         <source>
                           <mandatory>false</mandatory>
                           <many>true</many>
                        </source>  
                        <target>
            <class>pref:type2</class>
            <mandatory>false</mandatory>
            <many>true</many>
         </target>
                  </association>
                  </associations>
       <type name="pref:type2">
            <title>typee2</title>
            <parent>cm:content</parent>
       </type>
     </types>
</model>


<config evaluator="model-type" condition="pref:type1">
     <forms>
         <form id="search">
            <field-visibility>
               <show id="cm:name" force="true"></show>
               <show id="pref:assoc1"></show>
          <show id="pref:assoc2"></show>
            </field-visibility>
           <appearance>
              <field id="cm:name" label="Name"></field>
              <field id="pref:assoc1" label="ass1"></field>
              <field id="pref:assoc2" label="ass2"></field>
           </appearance>
         </form> 
    </forms>
    </config> 

domilingos
Champ in-the-making
Champ in-the-making
The problem is that I can not find any results when I search the 2 association of the model (mymodel).

loftux
Star Contributor
Star Contributor
Associations is not searcheable by lucene. Only one special type of association is currently searcheable and that is categories.
You would have to add a rule or a behaviour and store the the username/pref:type name on update in a special field just used for searching.

domilingos
Champ in-the-making
Champ in-the-making
Associations is not searcheable by lucene. Only one special type of association is currently searcheable and that is categories.
You would have to add a rule or a behaviour and store the the username/pref:type name on update in a special field just used for searching.

Lofux thanks for the help. But what kind of rule should I create? Could you give an example?