ALTER ANALYZER statement

The ALTER ANALYZER statement can be used to modify an existing defined analyzer.

SurrealQL Syntax

ALTER ANALYZER [ IF EXISTS ] @name
[ FUNCTION fn::@function | DROP FUNCTION ]
[ TOKENIZERS @tokenizer, ... | DROP TOKENIZERS ]
[ FILTERS @filter, ... | DROP FILTERS ]
[ COMMENT @string | DROP COMMENT ]
-- Define an analyzer
DEFINE ANALYZER example_edgengram TOKENIZERS class FILTERS edgengram(1,3);

-- Shorten the edgengram
ALTER ANALYZER example_edgengram FILTERS edgengram(1,2);

-- Check the output
search::analyze("example_edgengram", "Apple banana!!");

Output

[
'A',
'Ap',
'b',
'ba',
'!',
'!!'
]

Was this page helpful?