You are here

protected static function Database::splitIntoWords in Search API 8

Splits the given string into words.

Word characters as seen by this method are only alphanumerics.

Parameters

string $text: The string to split.

Return value

string[] All groups of alphanumeric characters contained in the string.

3 calls to Database::splitIntoWords()
Database::convert in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Converts a value between two search types.
Database::getAutocompleteSuggestions in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Retrieves autocompletion suggestions for some user input.
Database::splitKeys in modules/search_api_db/src/Plugin/search_api/backend/Database.php
Splits a keyword expression into separate words.

File

modules/search_api_db/src/Plugin/search_api/backend/Database.php, line 1551

Class

Database
Indexes and searches items using the database.

Namespace

Drupal\search_api_db\Plugin\search_api\backend

Code

protected static function splitIntoWords($text) {
  return preg_split('/[^\\p{L}\\p{N}]+/u', $text, -1, PREG_SPLIT_NO_EMPTY);
}