06-12-2020 09:40 AM
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.
06-12-2020 09:57 AM
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.
06-12-2020 09:57 AM
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.
06-17-2020 10:03 AM
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
06-17-2020 12:00 PM
Hi @bip1989,
Thanks for accepting the solution and updating us - really useful to other users. Thanks @abhinavmishra14 too for providing the solution.
Take care,
06-20-2020 09:04 AM
Thanks for help @EddieMay
Explore our Alfresco products with the links below. Use labels to filter content by product module.