Index: trunk/phase3/includes/SearchEngine.php |
— | — | @@ -403,7 +403,7 @@ |
404 | 404 | if($wgMWSuggestTemplate) |
405 | 405 | return $wgMWSuggestTemplate; |
406 | 406 | else |
407 | | - return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}'; |
| 407 | + return $wgServer . $wgScriptPath . '/api.php?action=opensearch&search={searchTerms}&namespace={namespaces}&suggest=1'; |
408 | 408 | } |
409 | 409 | } |
410 | 410 | |
Index: trunk/phase3/includes/api/ApiOpenSearch.php |
— | — | @@ -42,10 +42,14 @@ |
43 | 43 | } |
44 | 44 | |
45 | 45 | public function execute() { |
| 46 | + global $wgEnableMWSuggest; |
46 | 47 | $params = $this->extractRequestParams(); |
47 | 48 | $search = $params['search']; |
48 | 49 | $limit = $params['limit']; |
49 | 50 | $namespaces = $params['namespace']; |
| 51 | + $suggest = $params['suggest']; |
| 52 | + # $wgEnableMWSuggest hit incoming when $wgEnableMWSuggest is disabled |
| 53 | + if( $suggest && !$wgEnableMWSuggest ) return; |
50 | 54 | |
51 | 55 | // Open search results may be stored for a very long time |
52 | 56 | $this->getMain()->setCacheMaxAge(1200); |
— | — | @@ -61,7 +65,7 @@ |
62 | 66 | public function getAllowedParams() { |
63 | 67 | return array ( |
64 | 68 | 'search' => null, |
65 | | - 'limit' => array ( |
| 69 | + 'limit' => array( |
66 | 70 | ApiBase :: PARAM_DFLT => 10, |
67 | 71 | ApiBase :: PARAM_TYPE => 'limit', |
68 | 72 | ApiBase :: PARAM_MIN => 1, |
— | — | @@ -73,6 +77,9 @@ |
74 | 78 | ApiBase :: PARAM_TYPE => 'namespace', |
75 | 79 | ApiBase :: PARAM_ISMULTI => true |
76 | 80 | ), |
| 81 | + 'suggest' => array( |
| 82 | + ApiBase :: PARAM_TYPE => 'integer' |
| 83 | + ), |
77 | 84 | ); |
78 | 85 | } |
79 | 86 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1463,7 +1463,7 @@ |
1464 | 1464 | * to ensure that client-side caches don't keep obsolete copies of global |
1465 | 1465 | * styles. |
1466 | 1466 | */ |
1467 | | -$wgStyleVersion = '204'; |
| 1467 | +$wgStyleVersion = '205'; |
1468 | 1468 | |
1469 | 1469 | |
1470 | 1470 | # Server-side caching: |