educative.io

How can we store the popularity number in the index?

Let’s assume we want to rank tweets by popularity, like how many likes or comments a tweet is getting, etc. In such a case, our ranking algorithm can calculate a ‘popularity number’ (based on the number of likes, etc.) and store it with the index.

How can we store the popularity number in this index (which currently has only words as its keys) ?

Course: https://www.educative.io/collection/5668639101419520/5649050225344512
Lesson: https://www.educative.io/collection/page/5668639101419520/5649050225344512/5738600293466112

Hi Sandeep_Joel,
I went through the lesson and what I understood was that the index has words as keys and TweetID’s as values. So one possible way for storing popularity index could be to store a pair (popularity index, Tweet ID) against each key.

1 Like