You are here

public function ParseModeInterface::parseInput in Search API 8

Parses search keys input by the user.

Parameters

string $keys: The keywords to parse.

Return value

array|string|null The parsed keywords – either a string, or an array specifying a complex search expression, or NULL if no keywords should be set for this input. An array will contain a '#conjunction' key specifying the conjunction type, and search strings or nested expression arrays at numeric keys. Additionally, a '#negation' key might be present, which means – unless it maps to a FALSE value – that the search keys contained in that array should be negated (that is, not be present in returned results). The negation works on the whole array, not on each contained term individually – that is, with the "AND" conjunction and negation, only results that contain all the terms in the array should be excluded; with the "OR" conjunction and negation, all results containing one or more of the terms in the array should be excluded.

4 methods override ParseModeInterface::parseInput()
Direct::parseInput in src/Plugin/search_api/parse_mode/Direct.php
Parses search keys input by the user.
NoUi::parseInput in tests/search_api_test_no_ui/src/Plugin/search_api/parse_mode/NoUi.php
Parses search keys input by the user.
Phrase::parseInput in src/Plugin/search_api/parse_mode/Phrase.php
Parses search keys input by the user.
Terms::parseInput in src/Plugin/search_api/parse_mode/Terms.php
Parses search keys input by the user.

File

src/ParseMode/ParseModeInterface.php, line 73

Class

ParseModeInterface
Defines an interface for parse mode plugins.

Namespace

Drupal\search_api\ParseMode

Code

public function parseInput($keys);