You can use the schema manager to perform CRUD actions on ArangoDB analyzers.
The schema manager supports the following analyzer functions:
$arangoClient->schema()->createAnalyzer([
'name' => 'myAnalyzer',
'type' => 'identity',
]);
$arangoClient->schema()->getAnalyzer('myAnalyzer');
$arangoClient->schema()->getAnalyzers();
$arangoClient->schema()->hasAnalyzer('myAnalyzer');
This will delete the old analyzer and create a new one under the same name.
$arangoClient->schema()->replaceAnalyzer('myAnalyzer', [
'name' => 'myAnalyzer',
'type' => 'identity',
]);
Delete the analyzer by its name.
$arangoClient->schema()->deleteAnalyzer('myAnalyzer');
This method deletes all custom analyzers available on the current database.
$arangoClient->schema()->deleteAllAnalyzers();