From a863ac773a20db294b5bd26701c6a40da4cfc095 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 5 Mar 2026 13:30:54 +0530 Subject: [PATCH] updated index specs --- .../VectorDB/Collections/Indexes/Create.php | 2 +- src/Appwrite/SDK/Specification/Format.php | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php index 683b83c0da..ed0b465a71 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorDB/Collections/Indexes/Create.php @@ -58,7 +58,7 @@ class Create extends IndexCreate ->param('databaseId', '', new UID(), 'Database ID.') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).') ->param('key', null, new Key(), 'Index Key.') - ->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL, Database::INDEX_HNSW_EUCLIDEAN,Database::INDEX_HNSW_DOT, Database::INDEX_HNSW_COSINE]), 'Index type.') + ->param('type', null, new WhiteList([Database::INDEX_HNSW_EUCLIDEAN,Database::INDEX_HNSW_DOT, Database::INDEX_HNSW_COSINE, Database::INDEX_OBJECT, Database::INDEX_KEY, Database::INDEX_UNIQUE]), 'Index type.') ->param('attributes', null, new ArrayList(new Key(true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of attributes to index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' attributes are allowed, each 32 characters long.') ->param('orders', [], new ArrayList(new WhiteList(['ASC', 'DESC'], false, Database::VAR_STRING), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of index orders. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' orders are allowed.', true) ->param('lengths', [], new ArrayList(new Nullable(new Integer()), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Length of index. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE, optional: true) diff --git a/src/Appwrite/SDK/Specification/Format.php b/src/Appwrite/SDK/Specification/Format.php index 5f9f8ba56d..348a32603b 100644 --- a/src/Appwrite/SDK/Specification/Format.php +++ b/src/Appwrite/SDK/Specification/Format.php @@ -349,7 +349,6 @@ abstract class Format } break; case 'documentsDB': - case 'vectorDB': switch ($method) { case 'getUsage': case 'listUsage': @@ -368,6 +367,25 @@ abstract class Format } } break; + case 'vectorDB': + switch ($method) { + case 'getUsage': + case 'listUsage': + case 'getCollectionUsage': + switch ($param) { + case 'range': + return 'UsageRange'; + } + break; + case 'createIndex': + switch ($param) { + case 'type': + return 'VectorIndexType'; + case 'orders': + return 'OrderBy'; + } + } + break; case 'functions': switch ($method) { case 'getUsage':