You are here

protected function SearchApiSolrService::getQueryFields in Search API Solr 7

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

SearchApiQueryInterface $query: The search query.

Return value

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

See also

SearchApiQueryInterface::getFields()

3 calls to SearchApiSolrService::getQueryFields()
SearchApiSolrService::extractResults in includes/service.inc
Extract results from a Solr response.
SearchApiSolrService::getAutocompleteSuggestions in includes/service.inc
SearchApiSolrService::search in includes/service.inc
Executes a search on the server represented by this object.

File

includes/service.inc, line 2756

Class

SearchApiSolrService
Search service class using Solr server.

Code

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