20 private $extraData = [];
28 foreach ( $data as $id => $resultData ) {
29 $this->extraData[$id][$name] = $resultData;
38 $id = $result->getTitle()->getArticleID();
42 $result->setExtensionData(
function () use ( $id ) {
43 return $this->extraData[$id] ?? [];
58 return new ArrayIterator( $this->extractResults() );
setAugmentedData( $name, $data)
Sets augmented data for result set.
augmentResult(SearchResult $result)
Returns extra data for specific result and store it in SearchResult object.
NOTE: this class is being refactored into an abstract base class.
trait SearchResultSetTrait
Trait useful for SearchResultSet implementations.