experimental_fulltext2_index¶
The
experimental_fulltext2_indexsystem variable controls whether the FULLTEXT2 index engine is enabled. When set to0(default),CREATE FULLTEXT2 INDEXstatements are rejected andMATCH(...) AGAINST(...)cannot use a FULLTEXT2 index. Set it to1before creating a FULLTEXT2 index to enable the engine.
The experimental_fulltext2_index system variable gates access to the FULLTEXT2 index
engine in MatrixOne. When enabled, you can create FULLTEXT2 indexes on text columns and
use MATCH(...) AGAINST(...) for phrase, boolean, and BM25 search. FULLTEXT2 is a WAND
positional engine whose natural-language mode is an exact phrase match. Because this is
an experimental feature, the variable defaults to 0 and must be explicitly enabled
before use.
Syntax¶
SET GLOBAL experimental_fulltext2_index = 0; SET SESSION experimental_fulltext2_index = 1;
Query the current value:
SHOW VARIABLES LIKE ‘experimental_fulltext2_index’; SELECT @@experimental_fulltext2_index;
Arguments¶
Property |
Value |
|---|---|
Variable Type |
|
Scope |
|
Dynamic |
|
Default Value |
|
Optional Value |
|
Examples¶
DROP DATABASE IF EXISTS ft2_gate_demo;
CREATE DATABASE ft2_gate_demo;
USE ft2_gate_demo;
SET experimental_fulltext2_index = 1;
CREATE TABLE docs (id BIGINT PRIMARY KEY, body TEXT);
INSERT INTO docs VALUES (1, 'hello world'), (2, 'foo bar baz');
CREATE FULLTEXT2 INDEX ftidx ON docs(body);
SELECT id FROM docs WHERE MATCH(body) AGAINST('hello');
DROP DATABASE ft2_gate_demo;
Constraints¶
experimental_fulltext2_indexdefaults to0. AttemptingCREATE FULLTEXT2 INDEXwhile the variable is0causes the operation to fail.FULLTEXT2 is distinct from the classic fulltext engine gated by
experimental_fulltext_index; the two variables are independent.FULLTEXT2 relevance is controlled by its own variable,
ft2_relevancy_algorithm, which defaults toBM25.This is an experimental feature. Its behavior, performance characteristics, and API may change in future releases.