You are here

public function SearchApiQuery::parseModes in Search API 7

Retrieves the parse modes supported by this query class.

Return value

array An associative array of parse modes recognized by objects of this class. The keys are the parse modes' ids, values are associative arrays containing the following entries:

  • name: The translated name of the parse mode.
  • description: (optional) A translated text describing the parse mode.

Overrides SearchApiQueryInterface::parseModes

1 call to SearchApiQuery::parseModes()
SearchApiQuery::__construct in includes/query.inc
Constructs a new search query.

File

includes/query.inc, line 471
Contains SearchApiQueryInterface and SearchApiQuery.

Class

SearchApiQuery
Provides a standard implementation of the SearchApiQueryInterface.

Code

public function parseModes() {
  $modes['direct'] = array(
    'name' => t('Direct query'),
    'description' => t("Don't parse the query, just hand it to the search server unaltered. " . "Might fail if the query contains syntax errors in regard to the specific server's query syntax."),
  );
  $modes['single'] = array(
    'name' => t('Single term'),
    'description' => t('The query is interpreted as a single keyword, maybe containing spaces or special characters.'),
  );
  $modes['terms'] = array(
    'name' => t('Multiple terms'),
    'description' => t('The query is interpreted as multiple keywords separated by spaces. ' . 'Keywords containing spaces may be "quoted". Quoted keywords must still be separated by spaces.'),
  );

  // @todo Add fourth mode for complicated expressions, e.g.: »"vanilla ice" OR (love NOT hate)«
  return $modes;
}