Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting by popular count will sort by ascending popularity #12788

Open
gannebamm opened this issue Dec 13, 2024 · 1 comment
Open

Sorting by popular count will sort by ascending popularity #12788

gannebamm opened this issue Dec 13, 2024 · 1 comment
Labels
minor A low priority issue which might affect only some users and /or not the main functionality regression Issues related to regressions.

Comments

@gannebamm
Copy link
Contributor

Expected Behavior

Sorting by popular count will sort items by descending popularity. E.g. the most popular item is the first to be shown.

Actual Behavior

Sorting by popular count will sort items by ascending popularity. Therefore the least popular item is the first to be shown. This is counter-intuitive.

Steps to Reproduce the Problem

  1. Check popularity in Django admin (formerly it was displayed in Frontend)
  2. Use catalogue sorting to sort by popularity
  3. See popular ressources being listed last

or by API

popular count is '0'

popular count is > 7000

Specifications

  • GeoNode version: 4.4.2 (stable)
  • Installation type (vanilla, geonode-project):
  • Installation method (manual, docker):
  • Platform:
  • Additional details:
@gannebamm gannebamm added regression Issues related to regressions. minor A low priority issue which might affect only some users and /or not the main functionality labels Dec 13, 2024
@giohappy
Copy link
Contributor

@gannebamm you're right, the sorting should be descending and the fix is quick. It's just a matter of adding a minus sign to the sort parameter (https://stable.demo.geonode.org/api/v2/resources?page=1&sort[]=-popular_count).

The point is, can we rely on the popular_count attribute? I have investigated a bit and it doesn't seem to work anymore. The count is incremented by legacy code paths that are not hit anymore (at least for the most part if not totally).

Counting views is more of an analytics feature. We have been discussing to implement again analytics support inside GeoNode, although backed by external services. I have been experimenting with Plausible and some vanilla JS frontend code connected to the MapStore events API. It works, but it needs funding to be fully implemented and published.

I would be inclined to remove popular_count from GeoNode 5, unless someone wants resurrect it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor A low priority issue which might affect only some users and /or not the main functionality regression Issues related to regressions.
Projects
None yet
Development

No branches or pull requests

2 participants