| Index: trunk/phase3/includes/api/ApiQuerySearch.php |
| — | — | @@ -139,6 +139,35 @@ |
| 140 | 140 | if ( isset( $prop['timestamp'] ) ) { |
| 141 | 141 | $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $result->getTimestamp() ); |
| 142 | 142 | } |
| | 143 | + if ( !is_null( $result->getScore() ) ) { |
| | 144 | + if ( isset( $prop['score'] ) ) { |
| | 145 | + $vals['score'] = $result->getScore(); |
| | 146 | + } |
| | 147 | + } |
| | 148 | + if ( isset( $prop['titlesnippet'] ) ) { |
| | 149 | + $vals['titlesnippet'] = $result->getTitleSnippet( $terms ); |
| | 150 | + } |
| | 151 | + if ( !is_null( $result->getRedirectTitle() ) ) { |
| | 152 | + if ( isset( $prop['redirecttitle'] ) ) { |
| | 153 | + $vals['redirecttitle'] = $result->getRedirectTitle(); |
| | 154 | + } |
| | 155 | + if ( isset( $prop['redirectsnippet'] ) ) { |
| | 156 | + $vals['redirectsnippet'] = $result->getRedirectSnippet( $terms ); |
| | 157 | + } |
| | 158 | + } |
| | 159 | + if ( !is_null( $result->getSectionTitle() ) ) { |
| | 160 | + if ( isset( $prop['sectiontitle'] ) ) { |
| | 161 | + $vals['sectiontitle'] = $result->getSectionTitle(); |
| | 162 | + } |
| | 163 | + if ( isset( $prop['sectionsnippet'] ) ) { |
| | 164 | + $vals['sectionsnippet'] = $result->getSectionSnippet(); |
| | 165 | + } |
| | 166 | + } |
| | 167 | + if ( isset( $prop['hasrelated'] ) ) { |
| | 168 | + if ( $result->hasRelated() ) { |
| | 169 | + $vals['hasrelated'] = ""; |
| | 170 | + } |
| | 171 | + } |
| 143 | 172 | |
| 144 | 173 | // Add item to results and see whether it fits |
| 145 | 174 | $fit = $this->getResult()->addValue( array( 'query', $this->getModuleName() ), |
| — | — | @@ -198,7 +227,14 @@ |
| 199 | 228 | 'size', |
| 200 | 229 | 'wordcount', |
| 201 | 230 | 'timestamp', |
| | 231 | + 'score', |
| 202 | 232 | 'snippet', |
| | 233 | + 'titlesnippet', |
| | 234 | + 'redirecttitle', |
| | 235 | + 'redirectsnippet', |
| | 236 | + 'sectiontitle', |
| | 237 | + 'sectionsnippet', |
| | 238 | + 'hasrelated', |
| 203 | 239 | ), |
| 204 | 240 | ApiBase::PARAM_ISMULTI => true, |
| 205 | 241 | ), |
| — | — | @@ -222,10 +258,17 @@ |
| 223 | 259 | 'info' => 'What metadata to return', |
| 224 | 260 | 'prop' => array( |
| 225 | 261 | 'What properties to return', |
| 226 | | - ' size - Adds the size of the page in bytes', |
| 227 | | - ' wordcount - Adds the word count of the page', |
| 228 | | - ' timestamp - Adds the timestamp of when the page was last edited', |
| 229 | | - ' snippet - Adds a parsed snippet of the page', |
| | 262 | + ' size - Adds the size of the page in bytes', |
| | 263 | + ' wordcount - Adds the word count of the page', |
| | 264 | + ' timestamp - Adds the timestamp of when the page was last edited', |
| | 265 | + ' score - Adds the score (if any) from the search engine', |
| | 266 | + ' snippet - Adds a parsed snippet of the page', |
| | 267 | + ' titlesnippet - Adds a parsed snippet of the page title', |
| | 268 | + ' redirectsnippet - Adds a parsed snippet of the redirect', |
| | 269 | + ' redirecttitle - Adds a parsed snippet of the redirect title', |
| | 270 | + ' sectionsnippet - Adds a parsed snippet of the matching section', |
| | 271 | + ' sectiontitle - Adds a parsed snippet of the matching section title', |
| | 272 | + ' hasrelated - Indicates whether a related search is available', |
| 230 | 273 | ), |
| 231 | 274 | 'redirects' => 'Include redirect pages in the search', |
| 232 | 275 | 'offset' => 'Use this value to continue paging (return by query)', |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -470,7 +470,8 @@ |
| 471 | 471 | ApiRsdServiceApis for extensions to add their own service to the services |
| 472 | 472 | list. |
| 473 | 473 | * The HTML of diff output markers has changed. Hyphens are now minus signs, |
| 474 | | - empty markers are now filled with non-breaking-space characters. |
| | 474 | + empty markers are now filled with non-breaking-space characters |
| | 475 | +* (bug 25741) Add more data to list=search's srprop |
| 475 | 476 | |
| 476 | 477 | === Languages updated in 1.17 === |
| 477 | 478 | |