Reputation: 149
I've added the aspect cm:taggable in the advanced search for search by tags. When the user select one tag to search, Alfresco returns all documents that have the tag selected, but when the users select two or more tags, Alfresco returns nothing.
Using alfresco community edition 4.2.c
Upvotes: 1
Views: 1605
Reputation: 11
There is a required control-param value to get this to work in most recent versions of alfresco. Its documented in:
https://wiki.alfresco.com/wiki/Forms#category.ftl
But the bottom line is in the appearance setting of the form configuration you need a mode set for this to work on the category.ftl:
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
<control-param name="mode">AND</control-param> <!-- AND or OR -->
</control>
</field>
Upvotes: 1
Reputation: 149
There is no configuration for this, solved this issue by re-coding getSearchResults(params) in search.lib.js by adding an entry of tags in query.
Upvotes: 0
Reputation: 575
Well i added
<show id="cm:taggable" for-mode="edit" force="true" />
<field id="cm:taggable">
<control>
<control-param name="compactMode">true</control-param>
<control-param name="params">aspect=cm:taggable</control-param>
<control-param name="createNewItemUri">/api/tag/workspace/SpacesStore</control-param>
<control-param name="createNewItemIcon">tag</control-param>
</control>
</field>
I can now search by tags but it gives me 0 results when I try. If I enter the tagname as a keyword, the content with attached tags are showing.
E.G: I have some files with a tag "invoice" . When I do an advanced search on tag invoice it gives 0 results, but when I enter it as a keyword, the content with the tag "invoice" is shows. I don't know what the reason is, maybe this can help you in any possible way
regards
Upvotes: 0