# How is the "top" order determined

**URL:** https://meta.discourse.org/t/how-is-the-top-order-determined/57890
**Category:** Site feedback
**Created:** [2월 24, 2017, 11:21오전 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890 "2017-02-24T11:21:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [2월 24, 2017, 12:17오후 UTC](https://meta.discourse.org/t/how-is-the-top-order-determined/57890/2 "2017-02-24T12:17:34Z")

</div>

You can see the explanation in the tooltip of the “top” menu. It says “the most active topics in the last year, month, week or day”.

> <https://github.com/discourse/discourse/blob/main/app/models/top_topic.rb#L252-L256>

As you can see Discourse calculating topic score for all the periods using the counting of posts, views, topic likes and post likes. And topics will be displayed in descending order of the `PERIOD_score`.

@sam I just noticed `quarterly_score` index is missing (or no need?) [here](https://github.com/discourse/discourse/blob/master/db/migrate/20150727210748_add_quarterly_to_top_topics.rb) while all other periods having their own score index. Yes I already know it will not affect the result.

---

_[View the full topic](https://meta.discourse.org/t/how-is-the-top-order-determined/57890)._
