Page MenuHomePhabricator

Output article ID in API search
Closed, ResolvedPublic

Description

Wish: As a user, I want both the page title and the page ID to be shown in the search results, when I use the API search. Currently, only the page title is shown.
Ideally, displaying the page ID would be optional.

Survey: 2017

Original wish (German): https://de.wikipedia.org/wiki/Wikipedia:Umfragen/Technische_W%C3%BCnsche_2017/Suchen#Artikel-ID_in_der_API-Suche_ausgeben

This ticket is tagged as Need-volunteer to be tackled during the Wikimania Hackathon 2017.

Event Timeline

Restricted Application added a project: TCB-Team. · View Herald TranscriptAug 7 2017, 3:27 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptAug 9 2017, 1:45 PM
ShapeOfMatter added a subscriber: ShapeOfMatter.

wish me luck.

thiemowmde triaged this task as Normal priority.Aug 9 2017, 4:20 PM
thiemowmde added a subscriber: thiemowmde.

@ShapeOfMatter, are you adding a pageid parameter to the srprop parameter of the search API? I think that's the way to go.

Can you add me as a reviewer please?

wish me luck.

Good luck!

@ShapeOfMatter, are you adding a pageid parameter to the srprop parameter of the search API? I think that's the way to go.

Can you add me as a reviewer please?

I assume I can do both of those things :) but i'm not yet sure how. Let me know if you'd like to talk about this at all.

ShapeOfMatter moved this task from Backlog to Doing on the good first bug board.Aug 9 2017, 5:12 PM

Looking at the docs for the search API, and experimenting with the API sandbox, I'm not sure it does make sense to add an srprop parameter. The page title is returned without being specified in srprop, and one would imagine the page id to be similarly fundamental. Assuming the results are being ingested properly as json objects by all users, adding a new field they weren't expecting shouldn't have any downsides.

I'm still getting oriented. I'm hoping to learn more about how to actually work on this ticket at the 2pm beginers' workshop.

[…] one would imagine the page id to be similarly fundamental. […] adding a new field […] shouldn't have any downsides.

This sound good to me. Go ahead!

Change 370955 had a related patch set uploaded (by ShapeOfMatter; owner: ShapeOfMatter):
[mediawiki/core@master] Add page id to the API representation of pages in search results

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

Change 370955 merged by jenkins-bot:
[mediawiki/core@master] Add page id to the API representation of pages in search results

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

Legoktm closed this task as Resolved.Aug 10 2017, 5:18 PM
Legoktm added a subscriber: Legoktm.

Congrats on your first patch!

@JStrodt_WMDE @Bmueller this wish seems fulfilled now. \o/

FNDE awarded a token.Aug 21 2017, 3:34 PM
FNDE added a subscriber: FNDE.

Thank you for fulfilling my wish! :-)