Page MenuHomePhabricator

pageid="0" in the search results for a interwiki search through the API
Open, LowPublicFeature

Description

With using search API query for interwiki search (&srinterwiki=1 option) we saw pageid="0" for all results from projects that are different from the initial one.

Steps to Reproduce:

As example, requested from en-wikipedia:

https://en.wikipedia.org/w/api.php?action=query&list=search&format=xml&redirects=resolve&srlimit=1&srenablerewrites=1&&srprop=snippet&srinterwiki=1&srsearch=Tolstoy

Actual Results:

<api batchcomplete="">
<continue sroffset="1" continue="-||"/>
<query>
<searchinfo totalhits="4331"/>
<search>
<p ns="0" title="Leo Tolstoy" pageid="18622119" snippet="Count Lev Nikolayevich <span class="searchmatch">Tolstoy</span> (/ˈtoʊlstɔɪ, ˈtɒl-/; Russian: Лев Николаевич Толстой, tr. Lev Nikoláyevich <span class="searchmatch">Tolstóy</span>; [lʲef nʲɪkɐˈlaɪvʲɪtɕ tɐlˈstoj] (listen);"/>
</search>
<interwikisearch>
<wikt>
<_v ns="0" title="Tolstoy" pageid="0" snippet="From Russian Толсто́й (Tolstój), from a stress variant of the ancestor of то́лстый (tólstyj, “stout”). <span class="searchmatch">Tolstoy</span> A surname​." namespace="" url="https://en.wiktionary.org/wiki/Tolstoy"/>
</wikt>
<s>
<_v ns="0" title="A Confession (Tolstoy)" pageid="0" snippet="of Исповедь (A Confession) by Leo <span class="searchmatch">Tolstoy</span> 1996511English-language translations of Исповедь (A Confession)Leo <span class="searchmatch">Tolstoy</span> English-language translations of Исповедь" namespace="" url="https://en.wikisource.org/wiki/A_Confession_(Tolstoy)"/>
</s>
<q>
<_v ns="0" title="Leo Tolstoy" pageid="0" snippet="Lev Nikolayevitch <span class="searchmatch">Tolstoy</span> [Ле́в Никола́евич Толсто́й, usually rendered Leo <span class="searchmatch">Tolstoy</span>, or sometimes Tolstoi] (9 September 1828 – 20 November 1910) was a Russian" namespace="" url="https://en.wikiquote.org/wiki/Leo_Tolstoy"/>
</q>
<b>
<_v ns="0" title="Anarchist FAQ/What is Anarchism?/3.7" pageid="0" snippet="anarchist movement with the work of the famous Russian author Leo <span class="searchmatch">Tolstoy</span>. <span class="searchmatch">Tolstoy</span> took the message of the Bible seriously and came to consider that a" namespace="" url="https://en.wikibooks.org/wiki/Anarchist_FAQ/What_is_Anarchism%3F/3.7"/>
</b>
</interwikisearch>
<interwikisearchinfo totalhits="1855"/>
</query>
</api>

Expected Results:

<api batchcomplete="">
<continue sroffset="1" continue="-||"/>
<query>
<searchinfo totalhits="4331"/>
<search>
<p ns="0" title="Leo Tolstoy" pageid="18622119" snippet="Count Lev Nikolayevich <span class="searchmatch">Tolstoy</span> (/ˈtoʊlstɔɪ, ˈtɒl-/; Russian: Лев Николаевич Толстой, tr. Lev Nikoláyevich <span class="searchmatch">Tolstóy</span>; [lʲef nʲɪkɐˈlaɪvʲɪtɕ tɐlˈstoj] (listen);"/>
</search>
<interwikisearch>
<wikt>
<_v ns="0" title="Tolstoy" pageid="6592235" snippet="From Russian Толсто́й (Tolstój), from a stress variant of the ancestor of то́лстый (tólstyj, “stout”). <span class="searchmatch">Tolstoy</span> A surname​." namespace="" url="https://en.wiktionary.org/wiki/Tolstoy"/>
</wikt>
<s>
<_v ns="0" title="A Confession (Tolstoy)" pageid="1996511" snippet="of Исповедь (A Confession) by Leo <span class="searchmatch">Tolstoy</span> 1996511English-language translations of Исповедь (A Confession)Leo <span class="searchmatch">Tolstoy</span> English-language translations of Исповедь" namespace="" url="https://en.wikisource.org/wiki/A_Confession_(Tolstoy)"/>
</s>
<q>
<_v ns="0" title="Leo Tolstoy" pageid="143" snippet="Lev Nikolayevitch <span class="searchmatch">Tolstoy</span> [Ле́в Никола́евич Толсто́й, usually rendered Leo <span class="searchmatch">Tolstoy</span>, or sometimes Tolstoi] (9 September 1828 – 20 November 1910) was a Russian" namespace="" url="https://en.wikiquote.org/wiki/Leo_Tolstoy"/>
</q>
<b>
<_v ns="0" title="Anarchist FAQ/What is Anarchism?/3.7" pageid="219749" snippet="anarchist movement with the work of the famous Russian author Leo <span class="searchmatch">Tolstoy</span>. <span class="searchmatch">Tolstoy</span> took the message of the Bible seriously and came to consider that a" namespace="" url="https://en.wikibooks.org/wiki/Anarchist_FAQ/What_is_Anarchism%3F/3.7"/>
</b>
</interwikisearch>
<interwikisearchinfo totalhits="1855"/>
</query>
</api>

Event Timeline

Kaganer renamed this task from pageid="0" in the search results for a interwiki search over the API to pageid="0" in the search results for a interwiki search through the API.Apr 19 2020, 12:51 AM

It is not possible to get the pageid from external wikis. All the entries with pageid = 0 have an url pointing to a different wiki.

daniel changed the subtype of this task from "Bug Report" to "Feature Request".
daniel moved this task from Inbox to Feature Requests to Review on the Platform Engineering board.
daniel subscribed.

Changing this to a feature request. It's not a bug, since the code is working as intended, and page ID 0 (i.e. "unknown") is correct in the context of the local wiki.
Returning the page ID relative to another project is not impossible, but may lead to misunderstandings.

MPhamWMF subscribed.

Closing out low/est priority tasks over 6 months old with no activity within last 6 months in order to clean out the backlog of tickets we will not be addressing in the near term. Please feel free to reopen if you think a ticket is important, but bare in mind that given current priorities and resourcing, it is unlikely for the Search team to pick up these tasks for the indefinite future. We hope that the requested changes have either been addressed by or made irrelevant by work the team has done or is doing -- e.g. upgrading Elasticsearch to a newer version will solve various ES-related problems -- or will be subsumed by future work in a more generalized way.

RhinosF1 removed a project: Discovery-Search.
RhinosF1 subscribed.

Re-opening tasks and removing from team workboard per IRC feedback given yesterday and discussion with MPham.