Wiki source code of Likes as Ratings
Last modified by Eleni Cojocariu on 2026/08/12 16:21
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Like has no store of its own: it delegates to the [[Ratings API>>extensions:Extension.Ratings API]] and drives it through a ##RatingsConfiguration## Component of its own, registered under the ##like## hint in {{scm path="xwiki-platform-core/xwiki-platform-like/xwiki-platform-like-api/src/main/java/org/xwiki/like/internal/LikeRatingsConfiguration.java"}}LikeRatingsConfiguration{{/scm}}. A like is a Rating whose vote is ##1##, and the settings of that Component are what turn a generic rating into a like. | ||
| 2 | |||
| 3 | |=Ratings setting|=Value for Like|=Consequence | ||
| 4 | |Scale upper bound|##1##|A like has no degree: it exists or it does not. | ||
| 5 | |Zero votes stored|No|Unliking deletes the Rating instead of storing a vote of ##0##, so counting Ratings is exactly counting likes. | ||
| 6 | |Ratings storage|##solr##|Likes live in Solr, not in an xobject on the liked page. | ||
| 7 | |Dedicated Solr core|No|Likes share the ##ratings## core with every other rating and are told apart by their ##like## manager id. | ||
| 8 | |Average rating stored|No|The Like API never reads an average. This is the only setting you can [[change>>documentation.xs.dev.like.storage-properties.WebHome]]. | ||
| 9 | |Excluded references|None|Any entity can be liked. | ||
| 10 | |||
| 11 | Because likes are kept in Solr, the extension declares the ##{root}## namespace and has to be installed for the whole farm rather than on a single wiki. |