cancel
Showing results for 
Search instead for 
Did you mean: 

Rating Documentation?

stevescott
Champ in-the-making
Champ in-the-making
I'm struggling with trying to figure out how to manage\manipulate ratings…

I have a custom webscript which does a search of the repository

var def =
   {
    query: querystring  ,
    store: "workspace://SpacesStore",
    language: "fts-alfresco",
    sort: [sort1],
    page: paging
   };
   
   searchresults = search.query(def);

So I then parse out that data into JSON and XML…

But how the heck to I get the current Rating of that item into there as well?
1 REPLY 1

mikeh
Star Contributor
Star Contributor
Here's an abbreviated version of how we do it for the "likes" scheme in Share:
const LIKES_SCHEME = "likesRatingScheme";
var isLiked = ratingService.getRating(node, LIKES_SCHEME) !== -1;
var totalLikes = ratingService.getRatingsCount(node, LIKES_SCHEME);

And here's the wiki documentation: http://wiki.alfresco.com/wiki/Rating_Service

Thanks,
Mike