# ALTER ANALYZER

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

_(since v3.0.5)_

The `ALTER ANALYZER` statement can be used to modify an existing defined [analyzer](/docs/reference/query-language/statements/define/analyzer.md).

## Statement syntax

**SurrealQL Syntax**

```syntax title="SurrealQL Syntax"
ALTER ANALYZER [ IF EXISTS ] @name
  [ FUNCTION fn::@function | DROP FUNCTION ]
  [ TOKENIZERS @tokenizer, ... | DROP TOKENIZERS ]
  [ FILTERS @filter, ... | DROP FILTERS ]
  [ COMMENT @string | DROP COMMENT ]
```

## Example usage

```surql
-- 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!!");
```

```surql title="Output"
[
	'A',
	'Ap',
	'b',
	'ba',
	'!',
	'!!'
]
```
