Page MenuHomePhabricator

Support backlinks/links column in _pageData
Closed, ResolvedPublic

Description

A desired Cargo feature preventing a DPL3 -> Cargo switch, for some, is lack of a "linksto" and "linksfrom" equivalent (links/backlinks).

Others have requested how to achieve the same (https://www.mediawiki.org/wiki/Extension_talk:Cargo/Archive_October_to_December_2018#In-page_list_of_backlinks_[RESOLVED]), and some have attempted workarounds using _fullText search to determine links -- we also just tried that, though we discovered full-text search doesn't work in the case of transclusion (including transclusion from extensions). Cargo cannot "see" transcluded content as belonging a page's full text (technically it doesn't). We can't search expanded page text (which would expand the transclusion) as can be done with DPL3, or can we?

In short, transclusion prevents full-text search as a viable workaround/tool for such cases (and I have to wonder where else transclusion may be an issue, what about transcluding/applying categories using templates?). Trying to account for, in workarounds, the different ways something might be linked to is also problematic. The (proposed) cargo links/backlinks column could render such workarounds unnecessary, though would need to account for transclusion, including from extensions (like the widely used LST extension, which we also use). The ugly workaround we're using currently, is to put a DPL3 "linksto" query into a template to a Cargo store parameter, to get its contents into a Cargo column.

Could cargo simply fetch and populate backlinks/links for _pageData, from MediaWiki (since such already exists), to populate the proposed/requested columns?--This would also perhaps work if Cargo is set up on a separate database (recommended)?

Alternatively (or perhaps also), could there be an expanded text column to search, which would then include transcluded contents? (Not sure if that suggestion is doable/advisable).

Event Timeline

Change #1166919 had a related patch set uploaded (by Jayanthvikashs; author: Jayanthvikashs):

[mediawiki/extensions/Cargo@master] Add _outgoingLinks to _pageData table

https://gerrit.wikimedia.org/r/1166919

Change #1166919 merged by jenkins-bot:

[mediawiki/extensions/Cargo@master] Add _outgoingLinks to _pageData table

https://gerrit.wikimedia.org/r/1166919

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

@FrozenPlum - I believe this is now done! Thank you for the suggestion. Instead of fields for both incoming and outgoing links, there is just a single new field in the _pageData table, "_outgoingLinks". I think just the one direction is enough to allow any of the data to be queried. If you encounter any issues, though, feel free to re-open this.