X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiQuerySearch.php;h=2c681f57af9eb69e81abed325a0f5c76f7f67bad;hb=dbad540cd37617879aff6f28ce9c016dd8049d4e;hp=0dd89228593894ecaffb36816127f83a0aeac421;hpb=1a81ba9bcb801de0be82fbd44332dada53800879;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 0dd8922859..2c681f57af 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -233,6 +233,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $title = $result->getTitle(); ApiQueryBase::addTitleInfo( $vals, $title ); + $vals['pageid'] = $title->getArticleID(); if ( isset( $prop['size'] ) ) { $vals['size'] = $result->getByteSize(); @@ -271,6 +272,16 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { if ( isset( $prop['isfilematch'] ) ) { $vals['isfilematch'] = $result->isFileMatch(); } + + if ( isset( $prop['extensiondata'] ) ) { + $extra = $result->getExtensionData(); + // Add augmented data to the result. The data would be organized as a map: + // augmentorName => data + if ( $extra ) { + $vals['extensiondata'] = ApiResult::addMetadataToResultVars( $extra ); + } + } + return $vals; } @@ -371,6 +382,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { 'categorysnippet', 'score', // deprecated 'hasrelated', // deprecated + 'extensiondata', ], ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_HELP_MSG_PER_VALUE => [],