Page MenuHomePhabricator

query/search API and runSearch.php return only label for Wikidata
Closed, ResolvedPublic

Description

When we are searching Wikidata (e.g. Special:Search) we have several things we want to see in the result:

  • Title (which is Q-id)
  • Label (with highlighting)
  • Alias if the alias was matched, with highlighting
  • Description (with highlighting if match happened there)

However, currently both action=query&list=search API and runSearch.php return only title, label snippet and description snippet. We want to improve this and make it possible to get more data on Wikidata from it.

Event Timeline

Smalyshev created this task.Dec 5 2017, 8:34 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 5 2017, 8:34 PM

We have SearchResultsAugment which allows to add data to standard SearchResult class and extract it with getExtensionData() later. Maybe we should use it to add the data and have ApiQuerySearch.php consume this data. Right now the code in ApiQuerySearch.php consumes only fixed list of values which can not be extended.

Restricted Application added a project: Discovery. · View Herald TranscriptDec 5 2017, 8:37 PM

Change 395682 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/core@master] Add parameter for query/search to fetch augmented data.

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

Smalyshev updated the task description. (Show Details)Dec 6 2017, 1:19 AM

Change 395685 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/extensions/CirrusSearch@master] Add extra data from extensions to runSearch result

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

Change 395685 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Add extra data from extensions to runSearch result

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

Smalyshev triaged this task as Normal priority.Dec 6 2017, 6:24 PM

Change 395682 merged by jenkins-bot:
[mediawiki/core@master] Add parameter for query/search to fetch augmented data.

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

Smalyshev closed this task as Resolved.Dec 13 2017, 8:17 PM
Smalyshev claimed this task.
Smalyshev moved this task from Needs review to Done on the Discovery-Search (Current work) board.