Hi, I query special pages through API (concretely Special:UnconnectedPages), and I noticed that main namespace articles are yielded first. It seems that pages are ordered by namespace numbers. Is it a guaranteed behaviour?
(If so, I can break from the loop at te first page not in 0 namespace which would be nice.)
For Special:UnconnectedPages in particular, we designed the underlying page property so that it can be efficiently sorted or filtered by namespace (see T300770 https://phabricator.wikimedia.org/T300770 for details), so the fact that it starts with main namespace pages is intentional and guaranteed by the current code; I’d say this is unlikely to change soon, but I also don’t think we consider it covered by the Wikidata Stable Interface Policy https://www.wikidata.org/wiki/Wikidata:Stable_Interface_Policy.
For other query pages, it depends on the particular page; for instance, Special:PagesWithProp sorts by page_id https://gerrit.wikimedia.org/g/mediawiki/core/+/5fc28ecc5b/includes/specials/SpecialPagesWithProp.php#207 and Special:ShortPages by page_len https://gerrit.wikimedia.org/g/mediawiki/core/+/5fc28ecc5b/includes/specials/SpecialShortPages.php#158, if I’m reading the code correctly.
Am Do., 22. Feb. 2024 um 06:36 Uhr schrieb Bináris wikiposta@gmail.com:
Hi, I query special pages through API (concretely Special:UnconnectedPages), and I noticed that main namespace articles are yielded first. It seems that pages are ordered by namespace numbers. Is it a guaranteed behaviour?
(If so, I can break from the loop at te first page not in 0 namespace which would be nice.)
-- Bináris _______________________________________________ Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
wikitech-l@lists.wikimedia.org