You are here

protected function BackendPluginBase::getQueryFulltextFields in Search API 8

Retrieves the effective fulltext fields from the query.

Automatically translates a NULL value in the query object to all fulltext fields in the search index.

If a specific backend supports any "virtual" fulltext fields not listed in the index, it should override this method to add them, if appropriate.

Parameters

\Drupal\search_api\Query\QueryInterface $query: The search query.

Return value

string[] The fulltext fields in which to search for the search keys.

See also

\Drupal\search_api\Query\QueryInterface::getFulltextFields()

2 calls to BackendPluginBase::getQueryFulltextFields()
Database::createDbQuery in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Creates a database query for a search.
Database::getAutocompleteSuggestions in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Retrieves autocompletion suggestions for some user input.

File

src/Backend/BackendPluginBase.php, line 378

Class

BackendPluginBase
Defines a base class for backend plugins.

Namespace

Drupal\search_api\Backend

Code

protected function getQueryFulltextFields(QueryInterface $query) {
  $fulltext_fields = $query
    ->getFulltextFields();
  $index_fields = $query
    ->getIndex()
    ->getFulltextFields();
  return $fulltext_fields === NULL ? $index_fields : array_intersect($fulltext_fields, $index_fields);
}