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

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.

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

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 Medium 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 claimed this task.