Term
in package
A Term represents a word from text. This is the unit of search. It is composed of two elements, the text of the word, as a string, and the name of the field that the text occured in, an interned string.
Note that terms may represent more than words from text fields, but also things like dates, email addresses, urls, etc.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Object constructor
- getLength() : string
- Get UTF-8 string length
- getPrefix() : string
- Get term prefix
- key() : string
- Returns term key
Properties
$field
Field name or field number (depending from context)
public
mixed
$field
$text
Term value
public
string
$text
Methods
__construct()
Object constructor
public
__construct(mixed $text[, mixed $field = null ]) : mixed
Parameters
- $text : mixed
- $field : mixed = null
getLength()
Get UTF-8 string length
public
static getLength(string $str) : string
Parameters
- $str : string
Return values
stringgetPrefix()
Get term prefix
public
static getPrefix(string $str, int $length) : string
Parameters
- $str : string
- $length : int
Return values
stringkey()
Returns term key
public
key() : string