How do I get the most popular recommendations from the app?

Source: Internet
Author: User
The great gods ask a thought

If I have a click Count field, I want to output the hottest data list from the app

If the first row of data hits is exceeded by other data when the first page of the last pull is refreshed, then the refresh is not the data to repeat, such as the hottest line of Weibo, how it avoids refreshing the second page when the data on the first page is likely to be brushed to the second page.

Give another example, like real-time rankings. After you open the app, Xiao Wang is the first place. You after 5 minutes, and then upward drag, the king may be 20, refreshed the data, the front part of the small Wang, the latter part also has a small king. This is repeated, if the app side of the duplicate data culling, if the extreme situation may be refreshed in the second page is all repeated before, then the impression is that the second page can not be brushed

If you do a cache, you can't do it in real time. For the moment I think of a grievance perfection method like Weibo with since_id and max_id to get data by timeline way.

If you want to achieve pull-up refresh, how to avoid this problem?

Add:

For example, the first 5 minutes before the 10 data, 5 minutes after the 10-20, then if I pull up a refresh is 10 data, the first page and the second page pass the data is the same.

How can I avoid it?

Reply content:

The great gods ask a thought

If I have a click Count field, I want to output the hottest data list from the app

If the first row of data hits is exceeded by other data when the first page of the last pull is refreshed, then the refresh is not the data to repeat, such as the hottest line of Weibo, how it avoids refreshing the second page when the data on the first page is likely to be brushed to the second page.

Give another example, like real-time rankings. After you open the app, Xiao Wang is the first place. You after 5 minutes, and then upward drag, the king may be 20, refreshed the data, the front part of the small Wang, the latter part also has a small king. This is repeated, if the app side of the duplicate data culling, if the extreme situation may be refreshed in the second page is all repeated before, then the impression is that the second page can not be brushed

If you do a cache, you can't do it in real time. For the moment I think of a grievance perfection method like Weibo with since_id and max_id to get data by timeline way.

If you want to achieve pull-up refresh, how to avoid this problem?

Add:

For example, the first 5 minutes before the 10 data, 5 minutes after the 10-20, then if I pull up a refresh is 10 data, the first page and the second page pass the data is the same.

How can I avoid it?

The crux of the problem is the change of the chart and the range of changes, if according to the landlord said, the leaderboard change period is very short (the gap may change the page) change is also very large, the first 10 may be in the gap between the page down to 10-20.
If so, there is no need to do repetitive elimination, this frequency and amplitude of the ranking, did not actually the case
If the landlord must achieve the effect of non-repetition, in order to this frequency and amplitude of the ranking, the user should first access the entire leaderboard data (whether on the server or the client), the user page, no longer from the real-time data, but from the first access to the data already obtained. Then set a refresh list function, the user refreshes the current time to get all the leaderboard data.

Simply put, it is to refresh the list to get the list of data all, page pages do not get the list of data, only the selection of the saved list of the data of different pagination.

You said the situation is there, in fact, such as a micro-blog scenario is also very easy to happen (the first page of the data because the new micro-blog came in the second page)
The way to have a soil is to take the time you request the first page, it takes data earlier than this time, until the user refreshes the entire page, so the timeline will not be disrupted, but this is not applicable to the dynamic update ranking information
Another very earthy solution is that the client can check the received data, and if there are duplicates for additional processing, including not limited to deduplication, make additional requests to complete the data.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.