MediaWiki master
PerRowAugmentor.php
Go to the documentation of this file.
1<?php
2
3namespace MediaWiki\Search;
4
10
11 private ResultAugmentor $rowAugmentor;
12
16 public function __construct( ResultAugmentor $augmentor ) {
17 $this->rowAugmentor = $augmentor;
18 }
19
25 public function augmentAll( ISearchResultSet $resultSet ) {
26 $data = [];
27 foreach ( $resultSet->extractResults() as $result ) {
28 $id = $result->getTitle()->getArticleID();
29 if ( !$id ) {
30 continue;
31 }
32 $data[$id] = $this->rowAugmentor->augment( $result );
33 }
34 return $data;
35 }
36}
37
39class_alias( PerRowAugmentor::class, 'PerRowAugmentor' );
Perform augmentation of each row and return composite result, indexed by ID.
__construct(ResultAugmentor $augmentor)
augmentAll(ISearchResultSet $resultSet)
Produce data to augment search result set.
A set of SearchEngine results.
extractResults()
Extract all the results in the result set as array.
Definition of a mapping for the search index field.