You are here

public static function Utility::createTextToken in Search API 8

Creates a single text token.

Parameters

string $value: The word or other token value.

float $score: (optional) The token's score.

Return value

\Drupal\search_api\Plugin\search_api\data_type\value\TextTokenInterface A text token object.

6 calls to Utility::createTextToken()
HtmlFilter::parseHtml in src/Plugin/search_api/processor/HtmlFilter.php
Tokenizes an HTML string according to the HTML elements.
HtmlFilterTest::altConfigurationDataProvider in tests/src/Unit/Processor/HtmlFilterTest.php
Data provider method for testAltConfiguration().
HtmlFilterTest::tagConfigurationDataProvider in tests/src/Unit/Processor/HtmlFilterTest.php
Data provider method for testTagConfiguration().
TestFieldsProcessorPlugin::createTokenizedText in tests/src/Unit/Processor/TestFieldsProcessorPlugin.php
Tokenizes the given string by splitting on space characters.
Tokenizer::processFieldValue in src/Plugin/search_api/processor/Tokenizer.php
Processes a single text element in a field.

... See full list

File

src/Utility/Utility.php, line 31

Class

Utility
Contains utility methods for the Search API.

Namespace

Drupal\search_api\Utility

Code

public static function createTextToken($value, $score = 1.0) {
  return new TextToken($value, (double) $score);
}