Hello community
I am creating a custom search WebScript to support content personalized search. I am not able to find how to handle search for tags. When I checked the ootb search it seems tags are actually node refs and when search is happening it is using node refs.
how do i get the node ref from the tag value so i can try to follow same ootb search pattern or is there a way to implement search with value itself?
i am using SearchService for my custom search
Any pointers will be helpful, thanks.
Solved! Go to Solution.
Have you looked at TaggingService
https://docs.alfresco.com/5.2/references/API-JS-TaggingService.html
https://docs.alfresco.com/5.2/references/dev-services-tagging.html
It has a method :
org.alfresco.service.cmr.repository.NodeRef getTagNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef, String tag)
When you pass the tag value to this method it returns the noderef which can be appened to search query.
e.g.:
taggingService.getTagNodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, inputTagValue);
where inputTagValue is the value you will pass for a tag that you are trying to search.
Have you looked at TaggingService
https://docs.alfresco.com/5.2/references/API-JS-TaggingService.html
https://docs.alfresco.com/5.2/references/dev-services-tagging.html
It has a method :
org.alfresco.service.cmr.repository.NodeRef getTagNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef, String tag)
When you pass the tag value to this method it returns the noderef which can be appened to search query.
e.g.:
taggingService.getTagNodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, inputTagValue);
where inputTagValue is the value you will pass for a tag that you are trying to search.
Thank you @abhinavmishra14, it worked for me. I was able to get noderef from text value and then added in search processing and getting results
Hi @bip1989,
Thanks for accepting the solution and updating us - really useful to other users. Thanks @abhinavmishra14 too for providing the solution.
Take care,
Thanks for help @EddieMay
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.