From: Sam Reed Date: Tue, 26 Jul 2011 15:10:57 +0000 (+0000) Subject: * (bug 29748) Add API search prefix support X-Git-Tag: 1.31.0-rc.0~28617 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=4217b92e0e5b3b6f05bbc6e272646d3447531b0b;p=lhc%2Fweb%2Fwiklou.git * (bug 29748) Add API search prefix support Patch by TheDJ --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 3331752bca..a153d7c132 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -28,6 +28,7 @@ production. === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. +* (bug 29748) Add API search prefix support === Languages updated in 1.19 === diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index f7d9954c2d..47dc200298 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -69,6 +69,9 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $search->setNamespaces( $params['namespace'] ); $search->showRedirects = $params['redirects']; + $query = $search->transformSearchTerm( $query ); + $query = $search->replacePrefixes( $query ); + // Perform the actual search if ( $what == 'text' ) { $matches = $search->searchText( $query );