Index: trunk/phase3/includes/api/ApiQuerySearch.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | } |
50 | 50 | |
51 | 51 | private function run($resultPageSet = null) { |
52 | | - |
| 52 | + global $wgContLang; |
53 | 53 | $params = $this->extractRequestParams(); |
54 | 54 | |
55 | 55 | $limit = $params['limit']; |
— | — | @@ -87,6 +87,7 @@ |
88 | 88 | $this->dieUsage("{$what} search is disabled", |
89 | 89 | "search-{$what}-disabled"); |
90 | 90 | |
| 91 | + $terms = $wgContLang->convertForSearchResult($matches->termMatches()); |
91 | 92 | $titles = array (); |
92 | 93 | $count = 0; |
93 | 94 | while( $result = $matches->next() ) { |
— | — | @@ -104,6 +105,7 @@ |
105 | 106 | if (is_null($resultPageSet)) { |
106 | 107 | $vals = array(); |
107 | 108 | ApiQueryBase::addTitleInfo($vals, $title); |
| 109 | + $vals['snippet'] = $result->getTextSnippet($terms); |
108 | 110 | $fit = $this->getResult()->addValue(array('query', $this->getModuleName()), null, $vals); |
109 | 111 | if(!$fit) |
110 | 112 | { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -268,6 +268,7 @@ |
269 | 269 | * (bug 18720) Add anchor field to action=parse&prop=sections output |
270 | 270 | * (bug 19423) The initial file description page used caption in user lang |
271 | 271 | rather than UI lang |
| 272 | +* Added snippet field to list=search output |
272 | 273 | |
273 | 274 | === Languages updated in 1.16 === |
274 | 275 | |