cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced search for associations

dsmith
Champ on-the-rise
Champ on-the-rise
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-a...">this</a>, which indicates associations weren't searchable as of 3.4c, so maybe that's still the case.
7 REPLIES 7

afaust
Legendary Innovator
Legendary Innovator
Hello,

yes, associations are still not searchable in current release. They are just not being indexed…

Regards
Axel

mtsiak
Star Contributor
Star Contributor

what about 5.2? Are associations searchable? 

sercama
Confirmed Champ
Confirmed Champ

Alfresco 5.2 doesn't let search by associations yet.

theonax
Champ in-the-making
Champ in-the-making
Hi,
I was wondering if there is a solution to this problem by enabling indexing for associations.
I think this is a pretty often use case to be able to search documents based on association (e.g. assigned person, upstream document, …)

I found this plugin https://addons.alfresco.com/addons/citeck-ecos-journals and it is using Lucene queries for search (filtering)
I know for sure that search for associations worked in Alfresco 4.2 but is not working in 5.1.
Is there any reason why this was changed?
Example of query working in 4.2 and not working in 5.1 (without the association part it works just fine)

TYPE:"cez:contract" AND @cez\:contractType:"Main contract" AND cez\:contactPerson_added:"workspace://SpacesStore/86c04ee6-2758-41fe-b971-b6aa271378fa"


Is there a simple solution (I am fairly new to Alfresco) to ensure that associations are indexed and thus searchable?
It is configurable?

Thanks for answer

afaust
Legendary Innovator
Legendary Innovator
Searching for peer associations was not supported in Alfresco 4.2. What did work was searching for properties which could provide association-like relations and specific types of child associations.

There is no simple solution to ensure associations are indexed. You'd need to significantly enhance the indexing and searching components of Alfresco (core changes) to address this.

Regards
Axel

theonax
Champ in-the-making
Champ in-the-making
Hello,
so why the searching for properties providing association-like relations does not work anymore?
Was this Alfresco functionality removed on purpose? Is there any plan to enable searching for associations in future releases?
I think this is a fairly basic use case being able to search based on associations.
Also Advanced search provides possibility to define search forms with associations but it does not work. (looks like the association is ignored in search query as I get all the results)

Thanks for answer

afaust
Legendary Innovator
Legendary Innovator
Support for reference properties that provide association-like behaviour is still present. Nothing has been removed in that regard.