Thursday, April 15, 2010

Display SharePoint 2010 Social Tags in Search results XSL

I needed to display the SharePoint 2010 tags in custom search results XSLT.
After a bit of research, I understood that Managed Keywords == Tags
The property that we have to use to get to the tags is popularsocialtags.
But when users specify some terms in Managed Keywords and some in tags, sharePoint does not aggregate them by default. Therefore when we display them in search results, we need to merge them both and sort/filter them using XSLT.

You can expect to see the result from property "popularsocialtags" similar to "||1a8262b5-9c68-466c-9d17-bd446be783b1||24c38c92-b84b-49bd-9431-632222bc6c54|Stone Vendor;#||1a8262b5-9c68-466c-9d17-bd446be783b1"

Below XSL may help you display them delimited by ";" symbols

 
#

3 comments:

  1. Hi,

    Thanks for this blog post. This is the only information I could find on displaying social tags.

    Can you help me out with an issue, I have this in my XSL file

    Tags:




    but I don't see any tags on the search results page. I tagged the pages which will show up in the search results and I ran the full crawl, but no luck.

    ReplyDelete
  2. Hi can you repost? I do not see any xsl in your post

    ReplyDelete
  3. Hi,
    A great post !
    But i am having issue while crawling the tags..
    Can you specify the steps to include the tags in the search results?
    So far i have followed following steps
    1. crawled the my sites of the users and it stores the tag in crawled property "urn:schemas-microsoft-com:sharepoint:portal:profile:socialdata:SocialTagTextUrl"
    2. i mapped it to managed property "tags" and crawled the mysites again

    But still the tags are not coming in the fast search results..
    Am i missing anything ?

    Thanks,
    Dhaval Shah
    http://kalashnikovtechnoblogs.blogspot.com

    ReplyDelete