How does iNat sort observations by “faves” when there are no “faves”? If you have a series of observations, and sort by “faves”, iNat puts them in a very definitive order even if they’re not marked by anyone. Is this based on views, or is it just random? I’m just curious.
unless something has changed recently, this should still apply: https://forum.inaturalist.org/t/how-does-inat-sort-observations-after-initially-sorting-by-faves/74166
" it happens on tied non-zero favs groups too - basically the inat code has sql like ORDER BY cached_votes_total DESC NULLS LAST using single index for performance and nothing else for pure favourites sort aka no tie-breaking rules, so the postgres result order will be non-deterministic on ties whether they are tied at X value or zero favs you saw. It is technically correct sort but has unintended system effect as you see - the results order does fluctuate within the tied group (you can hard-refresh ctrl+shift+r and see for other vote ties), so since there is no explicit rule on tie-breaking, anything can happen at any stage…"
So what language is this, exactly?
Is this a way of saying it’s just random?
random isn’t the best word for it. it can appear random to some degree, but really, things will just get retrieved in whatever order the database finds and returns the records.
ideally, you would have a secondary ordering to break ties in your primary ordering, but for whatever reason, they didn’t implement things that way.
I think that’s “there is an order, but not one useful to or recognizable by humans, and it can change”.
Yes, can confirm that for all practical purposes there is no useful sorting applied, when two observations have the same number of faves.
In a perfect world, I would introduce sorting-options comments and ids that sort by their respective numbers.
Then I would allow the order_by= field to take an ordered list of these options, e.g. order_by=faves,ids,comments would first sort by number of faves, and if those are equal by number of identifications, and so on.
This would especially be useful, since from my experience agreeing IDs (for easy taxa) are often used as an alternative to favorites.