You are here

public function NumberFieldBoostTest::getSearchResults in Search API 8

Executes a search query and returns the results.

Results will be sorted by score and ID, descending.

Return value

\Drupal\search_api\Query\ResultSetInterface The search results.

Throws

\Drupal\search_api\SearchApiException Thrown if an error occurred during the search.

1 call to NumberFieldBoostTest::getSearchResults()
NumberFieldBoostTest::testNumberFieldBoost in tests/src/Kernel/Processor/NumberFieldBoostTest.php
Tests number field boost queries.

File

tests/src/Kernel/Processor/NumberFieldBoostTest.php, line 253

Class

NumberFieldBoostTest
Tests the "Number field boost" processor.

Namespace

Drupal\Tests\search_api\Kernel\Processor

Code

public function getSearchResults() : ResultSetInterface {
  return (new Query($this->index))
    ->keys('node')
    ->sort('search_api_relevance', QueryInterface::SORT_DESC)
    ->sort('search_api_id', Query::SORT_DESC)
    ->execute();
}