Page MenuHomePhabricator

Core REST API search results are different from Action API results
Closed, ResolvedPublic

Description

Web team is trying to use the /search/title endpoint, but they're getting different results than they expect. We need to determine the right results for them.

Event Timeline

Results for "jupiter" as returned by the Action API

[
    "Jupiter",
    "Jupiter (mythology)",
    "Jupiter Ascending",
    "Jupiter, Florida",
    "Jupiter's moons in fiction",
    "Jupiter's Legacy (comic)",
    "Jupiter trojan",
    "Jupiter Icy Moons Explorer",
    "Jupiter Award (film award)",
    "Jupiter Apple"
],

Results returned by the REST API search/title endpoint match the results from the Action API. Larger result sets appear to match as well (spot checked)

"Jupiter"
"Jupiter (mythology)"
"Jupiter Ascending"
"Jupiter, Florida"
"Jupiter's moons in fiction"
"Jupiter's Legacy (comic)"
"Jupiter trojan"
"Jupiter Icy Moons Explorer"
"Jupiter Award (film award)"
"Jupiter Apple"

Results returned by the REST API search/page endpoint

"Jupiter"
"Jupiter (mythology)"
"Moons of Jupiter"
"Jupiter Ascending"
"Jupiter trojan"
"Sailor Jupiter"
"Jupiter, Florida"
"Jupiter (disambiguation)"
"Ganymede (moon)"
"Return to Jupiter"

The results from the page endpoint differ after the third row. Do we need to look into why the search strategies differ?

Thank you, @holger.knust!

@ovasileva, @alexhollender, my understanding is that we will be replicating the existing search suggestion behavior of searching by title. When a user presses "search pages containing", they will simply be routed to Special:Search, correct?

@ovasileva, @alexhollender, my understanding is that we will be replicating the existing search suggestion behavior of searching by title.

I don't think I fully understand what this means but it sounds right

When a user presses "search pages containing", they will simply be routed to Special:Search, correct?

Yes

In T258736#6380972, @alexhollender wrote:

@ovasileva, @alexhollender, my understanding is that we will be replicating the existing search suggestion behavior of searching by title.

I don't think I fully understand what this means but it sounds right

When a user presses "search pages containing", they will simply be routed to Special:Search, correct?

Yes

👍

Waiting for review on what? there's no patch attached.

Closing this since there is nothing to be done at this point. Please reopen if additional work is required.

bearND subscribed.

I found another difference between the REST API and the Action API. This time in the description field. The REST API seems to prefer the central description, while I think it should prefer the local description instead.

REST API: https://en.wikipedia.org/w/rest.php/v1/search/title?q=media&limit=1 ->

"description": "Wikimedia disambiguation page"

Action API (default): https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=description&titles=Media ->

"description": "Disambiguation page providing links to topics that could be referred to by the same search term",
"descriptionsource": "local"

Action API (prefering central description) : https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&prop=description&titles=Media&descprefersource=central ->

"description": "Wikimedia disambiguation page", 
"descriptionsource": "central"
daniel lowered the priority of this task from High to Medium.Sep 7 2020, 8:22 PM
Jdlrobson subscribed.

The local description is now being served in https://en.wikipedia.org/w/rest.php/v1/search/title?q=media&limit=1 ("Disambiguation page providing links to topics that could be referred to by the same search term")