MediaWiki master
PerRowAugmentor.php
Go to the documentation of this file.
1<?php
2
8
9 private ResultAugmentor $rowAugmentor;
10
14 public function __construct( ResultAugmentor $augmentor ) {
15 $this->rowAugmentor = $augmentor;
16 }
17
23 public function augmentAll( ISearchResultSet $resultSet ) {
24 $data = [];
25 foreach ( $resultSet->extractResults() as $result ) {
26 $id = $result->getTitle()->getArticleID();
27 if ( !$id ) {
28 continue;
29 }
30 $data[$id] = $this->rowAugmentor->augment( $result );
31 }
32 return $data;
33 }
34}
Perform augmentation of each row and return composite result, indexed by ID.
augmentAll(ISearchResultSet $resultSet)
Produce data to augment search result set.
__construct(ResultAugmentor $augmentor)
A set of SearchEngine results.
extractResults()
Extract all the results in the result set as array.
Augment search results.
Augment search results.