AnsweredAssumed Answered

Advanced search for associations

Question asked by dsmith on Mar 26, 2015
Latest reply on Jul 6, 2016 by afaust
Alfresco version: Community 5.0.c

I have a custom content type that includes an association.  I would like to be able to include that association in Advanced Search in Share.  So users could select document A, and search would return all documents that include document A in their associated content.

In my share-config-custom.xml, I have the following:


<form id="search">
   <field-visibility>
      <show id="mcrd:relatedDocuments" force="true" />
   </field-visibility>
   <appearance>
      <field id="mcrd:relatedDocuments">
         <control template="/org/alfresco/components/form/controls/association.ftl" />
      </field>
   </appearance>
</form>



That gives me a picker that selects objects just fine, but always returns 0 results.  I'm still working on understanding Freemaker files, so I'm making the assumption it's returning more than just the object necessary for the search.

I tried it with /common/picker.inc.ftl, but that results in a blank field.

Searching for similar questions seems to indicate a custom picker often needs to be defined, but that's usually for more specific cases (like restricting visible content types in the picker, etc.).

I was thinking there must likely be some out of the box combination of control template and parameters that would result in a selection appropriate for submission to search.

Edit: just found <a href="https://forums.alfresco.com/forum/developer-discussions/alfresco-share-development/advanced-search-alfresco-share-02222011-1124">this</a>, which indicates associations weren't searchable as of 3.4c, so maybe that's still the case.

Outcomes