Some searches on stackexchange.com seem to give the wrong number of results. E.g. searching for url:wiki.openttd.org
gives 77 results, but they fit on 2 pages of max. 30 results; if you set the page size to 50, they all fit on one page. @rene's analysis is spot on: manually navigating to page 2 gives the other 27. The pagination is broken; it's not related to searching for URLs because searching for 'smokedetector' has pagination problems too.
1 Answer
This functionality is crucial in some cases of investigating spam or abuse.
I have therefore created a userscript to correct the functionality. See the Stack Apps post: Fix for the network search pagination
To make sure this post is self-contained:
Installation
Code:
// ==UserScript==
// @name Stack Exchange - fix network search pagination
// @namespace https://github.com/PurpleMagick/
// @description Network search pagination is broken and does not count pages correctly. This is a fix
// @author VLAZ
// @version 1.0.0
//
// @match https://stackexchange.com/search*
//
// @grant none
// ==/UserScript==
let __webpack_exports__ = {};
// CONCATENATED MODULE: ./src/paginationParametersHelpers.ts
function retrievePagesize() {
const searchParams = new URLSearchParams(window.location.search);
return Number(searchParams.get("pagesize") ?? 15);
}
function createCorrecURL(href, pagesize) {
const url = new URL(href);
url.searchParams.set("pagesize", String(pagesize));
return url;
}
// CONCATENATED MODULE: ./src/index.ts
function main() {
const perPage = retrievePagesize();
const searchParams = new URLSearchParams(window.location.search);
if (searchParams.has("pagesize") === false) {
window.location.href = createCorrecURL(window.location.href, perPage).href;
return;
}
document.querySelectorAll(".pager a")
.forEach(el => {
el.href = createCorrecURL(el.href, perPage).href;
});
}
main();
If you need to know how to install userscripts, see:
- the tag description over at Stack Apps
- the guide over at Greasyfork.
page=n
part of the URL.