public function Phrase::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.
Overrides ParseModeInterface::parseInput
File
- src/
Plugin/ search_api/ parse_mode/ Phrase.php, line 21
Class
- Phrase
- Represents a parse mode that interprets the input as a single phrase.
Namespace
Drupal\search_api\Plugin\search_api\parse_modeCode
public function parseInput($keys) {
return [
'#conjunction' => $this
->getConjunction(),
$keys,
];
}