Statistiques sur les publications les plus aimées de tous les temps ?

I’d like to know which posts on my forum have received the most likes since we first started running on Discourse (nearly 4 years ago).

I searched on here and found this, which appears to be the same question, but the topic is closed so I can’t add to it:

The solutions given on that other topic by @dax don’t actually give what I (or that other requester) am looking for:

discourse.example.com/?order=likes (likes gives in all topics)
or discourse.example.com/search type in:likes and order results by “most liked”

The first doesn’t work at all (and just defaults back to the home page of my forum).

The second only returns results for the most-liked posts that I myself have liked. See here:

When I type in:likes in the search field, it automatically checks the “I liked” box. If I then uncheck that box, the text in:likes in the search field is wiped along with it. I cannot have in:likes in the search field and an unchecked “I liked” box.

So – that’s not giving me what I want to know. Is there a way to get it?

Thanks in advance for any help!

1 « J'aime »

I think the best way would be using a query in the data explorer if you have it installed?

1 « J'aime »

We don’t, no.

1 « J'aime »

I just created this Data Explorer query with help from Gemini. Gives the top 10 most liked posts, ever.

-- Queries the top 10 most liked posts of all time (for modern Discourse versions)
SELECT
    p.id AS post_id,
    p.like_count,
    CONCAT('/t/', t.slug, '/', t.id, '/', p.post_number) AS url,
    t.title AS topic_title,
    p.user_id,
    u.username
FROM posts AS p
JOIN topics AS t ON t.id = p.topic_id
JOIN users AS u ON u.id = p.user_id
WHERE p.deleted_at IS NULL
  AND t.deleted_at IS NULL
  AND p.post_type = 1 -- 1 for regular posts
ORDER BY p.like_count DESC
LIMIT 10

I think you can just use the new /filter for that?

:right_arrow: https://meta.discourse.org/filter?q=order%3Alikes-op%20

1 « J'aime »