final class FullTextSearch
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A full-text search: MATCH (col, …) AGAINST (expr [mode]) (Item_func_match).

The column list may be written with or without parentheses, and a natural language search may state IN NATURAL LANGUAGE MODE; both forms are kept, since they are part of the text MySQL names an unaliased select list expression after. The search string is a bit_expr; before IN BOOLEAN MODE it may not end in a form that would take the IN.

Rule: MYSQL-FULLTEXT-001. Facts: the relevance, a DOUBLE; it is treated as possibly NULL. Every column is resolved in the environment. Terminates: the columns and the search string are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/fulltext-search.html#function_match. Status: Implemented.

Reading the searched columnsdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT a FROM t WHERE MATCH a, b AGAINST ('x' WITH QUERY EXPANSION)");
    [count($query->statement->where->columns), $query->toString()] // => [2, "SELECT a FROM t WHERE MATCH a, b AGAINST ('x' WITH QUERY EXPANSION)"]

Properties§

public non-empty-list<ColumnUse> $columns
public Scalar $against
public FullTextMode $mode = FullTextMode::NaturalLanguage
public OptionalWords $parentheses = OptionalWords::Written
public OptionalWords $stated = OptionalWords::Omitted

Methods§

public function __construct(
    list<ColumnUse> $columns,
    public Scalar $against,
    public FullTextMode $mode = FullTextMode::NaturalLanguage,
    public OptionalWords $parentheses = OptionalWords::Written,
    public OptionalWords $stated = OptionalWords::Omitted,
)

Parameters

$columnslist<ColumnUse>The searched columns in order; at least one
$againstScalarThe search string
$modeFullTextModeThe search mode
$parenthesesOptionalWordsWhether the column list is written in parentheses
$statedOptionalWordsWhether a natural language search writes IN NATURAL LANGUAGE MODE
Calls 12
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the columns and the search string; the relevance is a DOUBLE.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 8
public function render(Output $out): void

Writes MATCH, the columns, AGAINST, the search string and the mode.

Parameters

$outOutput
Test cases 1
Calls 7

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type declarations 1