tokens.php
Table of Contents
Functions
- tokens() : string
- Split input string(s) using the specified analyzer into an array of tokens.
Functions
tokens()
Split input string(s) using the specified analyzer into an array of tokens.
tokens(string $init, string $analyzer) : string
This helper wraps the ArangoDB AQL function TOKENS(input, analyzer) which
splits the input text using the specified analyzer and returns an array of tokens.
This is useful for text analysis and search operations.
Example AQL usage:
TOKENS("hello world", "text_en") // returns ["hello", "world"]
TOKENS("Hello, World!", "text_en") // returns ["hello", "world"]
TOKENS(doc.content, "text_en") // returns tokens from content
Parameters
- $init : string
-
Text expression to tokenize (accepts recursive arrays of strings).
- $analyzer : string
-
Name of the analyzer to use for tokenization.
Tags
Return values
string —The formatted AQL expression.