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 subscriber: Aklapper. · View Herald Transcript
thiemowmde triaged this task as Medium priority.Aug 9 2017, 4:20 PM
thiemowmde subscribed.

@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?

@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.

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 subscribed.

Congrats on your first patch!

FNDE subscribed.

Thank you for fulfilling my wish! :-)