From 0cfd102a6ecb172f04ec915732bd8ca6f6b2a7af Mon Sep 17 00:00:00 2001 From: Carey Halton Date: Wed, 31 May 2023 10:41:27 -0400 Subject: [PATCH] [Azure Cognitive Search] Fix vectorSearchAlgorithmConfiguration polymorphism, add vectorIndexSize to statistics (#24112) * Fix vectorSearchAlgorithmConfiguration polymorphism * Fix lintdiff * Fix vectorSearchConfiguration x-nullable to be true * Add vectorIndexSize to index and service statistics * Respond to feedback, fix build issues --- .../SearchServiceGetIndexStatistics.json | 3 +- .../SearchServiceGetServiceStatistics.json | 4 ++ .../2023-07-01-Preview/searchservice.json | 40 ++++++++++++++++--- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetIndexStatistics.json b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetIndexStatistics.json index e98dfa1688e8..ac9dc3c0873a 100644 --- a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetIndexStatistics.json +++ b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetIndexStatistics.json @@ -8,7 +8,8 @@ "200": { "body": { "documentCount": 239572, - "storageSize": 72375920 + "storageSize": 72375920, + "vectorIndexSize": 123456 } } } diff --git a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetServiceStatistics.json b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetServiceStatistics.json index 5f5f3ff256fd..bc85dd855fc8 100644 --- a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetServiceStatistics.json +++ b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/examples/SearchServiceGetServiceStatistics.json @@ -38,6 +38,10 @@ "skillsetCount": { "usage": 0, "quota": 3 + }, + "vectorIndexSize": { + "usage": 123456, + "quota": 26214400 } }, "limits": { diff --git a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchservice.json b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchservice.json index 228c428e2c22..96cccd375359 100644 --- a/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchservice.json +++ b/specification/search/data-plane/Azure.Search/preview/2023-07-01-Preview/searchservice.json @@ -6143,6 +6143,7 @@ }, "VectorSearchAlgorithmConfiguration": { "type": "object", + "discriminator": "kind", "properties": { "name": { "externalDocs": { @@ -6156,10 +6157,6 @@ "type": "string", "description": "The name of the kind of algorithm being configured for use with vector search. Only `hnsw` is supported in the current preview.", "x-nullable": false - }, - "hnswParameters": { - "$ref": "#/definitions/HnswParameters", - "description": "Contains the parameters specific to hnsw algorithm." } }, "required": [ @@ -6168,6 +6165,23 @@ ], "description": "Contains configuration options specific to the algorithm used during indexing time." }, + "HnswVectorSearchAlgorithmConfiguration": { + "type": "object", + "x-ms-discriminator-value": "hnsw", + "allOf": [ + { + "$ref": "#/definitions/VectorSearchAlgorithmConfiguration" + } + ], + "properties": { + "hnswParameters": { + "x-ms-client-name": "Parameters", + "$ref": "#/definitions/HnswParameters", + "description": "Contains the parameters specific to hnsw algorithm." + } + }, + "description": "Contains configuration options specific to the hnsw approximate nearest neighbors algorithm used during indexing time." + }, "HnswParameters": { "type": "object", "properties": { @@ -7398,7 +7412,7 @@ }, "vectorSearchConfiguration": { "type": "string", - "x-nullable": false, + "x-nullable": true, "description": "The name of the vector search algorithm configuration that specifies the algorithm and optional parameters for searching the vector field." }, "synonymMaps": { @@ -7981,6 +7995,12 @@ "x-nullable": false, "readOnly": true, "description": "The amount of storage in bytes consumed by the index." + }, + "vectorIndexSize": { + "type": "integer", + "format": "int64", + "readOnly": true, + "description": "The amount of memory in bytes consumed by vectors in the index." } }, "required": [ @@ -11430,15 +11450,23 @@ "x-ms-client-name": "skillsetCounter", "$ref": "#/definitions/ResourceCounter", "description": "Total number of skillsets." + }, + "vectorIndexSize": { + "x-ms-client-name": "vectorIndexSizeCounter", + "$ref": "#/definitions/ResourceCounter", + "description": "Total memory consumption of all vector indexes within the service, in bytes." } }, "required": [ + "aliasesCount", "documentCount", "indexesCount", "indexersCount", "dataSourcesCount", "storageSize", - "synonymMaps" + "synonymMaps", + "skillsetCount", + "vectorIndexSize" ], "description": "Represents service-level resource counters and quotas." },