3

I am trying to pull together a list of items / documents a user has "liked." I saw that there's a crawled property ows_LikedBy, but no managed property, so I created a managed property LikedBy and mapped it to the crawled property.

I tried to set up a Content Search web part with a simple query of LikedBy:{User.Name}, but that is not giving any results. I then noticed that the LikedBy field is hidden, which means it's not getting indexed.

So is there a way to query for items a user has liked? Either through a Content Search web part / keyword query, or through some other means?

I considered un-hiding the field so it will get crawled, but I don't like the idea of changing the settings on a base SP field.

Also, I saw this question about using SPServices to get the items a user has liked, but GetListItems will only return items from a particular list, and I need results from across the entire web app.

2
  • In SP2010 "I like it" was a social tag applied to a content, and data for 'liked' content were retrieved through Social Data web service, but this is probably not your case. Jan 16, 2015 at 19:27
  • Actually I started looking into the Social Data services, but I am having some trouble getting results, and I'm not sure if it is because of something wrong with my dev environment, or if "I like it" is no longer a social tag in SP2013. Can anyone confirm is "I like it" is still a social tag in SP2013, and that it is the default tag that gets applied when a user clicks the "Like" button? Jan 16, 2015 at 19:31

2 Answers 2

0

I found the a workaround if someone is stuck on the same issue like me.

  1. Create your own "LikedBy" column
  2. Create an ItemUpdated event receiver on the list where you copy the out of the box LikedBy column to your custom liked by column.
  3. Do a systemUpdate() in the event receiver to not change the modified date.

properties.ListItem["My_x0020_Liked_x0020_By"] = properties.ListItem["LikedBy"]; properties.ListItem.SystemUpdate();

  1. Get this custom field in your crawled properies and make sure it is mapped to be able to use it in your content search webpart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.