You are here

public function ProcessingResultsEvent::setResults in Search API 8

Sets the search results.

Usually, just making changes to the existing results object is sufficient, and that is the preferred way of changing results. However, in certain situations it can make sense to replace the results object with a completely new object instead, in which case this method can be used.

It should not be used unless really necessary, though, to avoid unintended side effects (in case of modules that assume the results object will stay unchanged).

Parameters

\Drupal\search_api\Query\ResultSetInterface $results: The new search results.

File

src/Event/ProcessingResultsEvent.php, line 55

Class

ProcessingResultsEvent
Wraps a processing results event.

Namespace

Drupal\search_api\Event

Code

public function setResults(ResultSetInterface $results) {
  $this->results = $results;
}