Page MenuHomePhabricator

The untuitive way of getting a list of all redirects on the wiki and their target doesn't work
Closed, DeclinedPublic

Description

The untuitive way of getting a list of all redirects on the wiki and their target doesn't work: the query below gives the error "Use "gapfilterredir=nonredirects" option instead of "redirects" when using allpages as a generator". Since I am already using "gapfilterredir=redirects" instead, this advice is quite unhelpful.

These both work:

I would expect my failing query to give similar results as the last example.

Event Timeline

Anomie subscribed.

This seems like a strange thing to want. But if you really want all redirects and their targets, apparently https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&generator=allredirects&redirects=1 doesn't have the same restriction and queries redirects a bit more directly.

OTOH, what we'd really want to do is to fix T31115: add redirect target value on page info (ApiQueryInfo), then you could use https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&generator=allredirects&prop=info with the appropriate inprop.