You are here

public function Stemmer::preprocessSearchQuery in Search API 8

Preprocesses a search query.

Parameters

\Drupal\search_api\Query\QueryInterface $query: The object representing the query to be executed.

Overrides FieldsProcessorPluginBase::preprocessSearchQuery

File

src/Plugin/search_api/processor/Stemmer.php, line 121

Class

Stemmer
Stems search terms.

Namespace

Drupal\search_api\Plugin\search_api\processor

Code

public function preprocessSearchQuery(QueryInterface $query) {

  // Only process queries that can (also) return English language content.
  $languages = $query
    ->getLanguages();
  if ($languages && !in_array('en', $languages)) {
    return;
  }
  parent::preprocessSearchQuery($query);
}