3

When I fire a POST/GET request with the following parameters, the API returns search result sorted by relevancy

array(
  'format' => 'json',
  'action' => 'query',
  'list' => 'search',
  'srsearch' => $query
);

example GET :
https://en.wikipedia.org/w/api.php?format=json&action=query&list=search&srsearch=bose+einstein+condensate

If you go to https://en.m.wikipedia.org/wiki/Main_Page#/search or https://en.wikipedia.org/wiki/Main_Page#/search, and enter the 'boss einstein condensate', instead of 'bose einstein condensate', it shows relevant suggestions. But if I do the same with the API, it returns irrelevant results.

Is there a way to get those suggestions from the API?

logi-kal
  • 7,107
  • 6
  • 31
  • 43
Lord Stiltskin
  • 133
  • 1
  • 8

0 Answers0