You can use the schema manager to perform CRUD actions on ArangoSearch views.
The schema manager supports the following view functions:
$arangoClient->schema()->createView([
'name' => 'testViewBasics',
'type' => 'arangosearch'
]);
$arangoClient->schema()->getView('testViewBasics');
$arangoClient->schema()->getViews();
$arangoClient->schema()->hasView('testViewBasics');
$arangoClient->schema()->getViewProperties('testViewBasics');
$arangoClient->schema()->renameView('testViewBasics', 'pages');
$arangoClient->schema()->updateView('pages', [
'cleanupIntervalStep' => 3
]);
Use replaceView if you want to update the primarySort or primarySortCompression. This will delete the old view and create a new one. The new view will need to be build from the data so might not be available right away.
$arangoClient->schema()->updateView('pages', [
'cleanupIntervalStep' => 3,
'primarySort' => [[
'field' => 'email',
'direction' => 'desc'
]]
]);
$arangoClient->schema()->deleteView('testViewBasics');