Vector search for NoSQL accounts (#1843)

* Add container vector policy and indexing policy support

* Add vector search capability

* hide vector settings for shared throughput DB

* update package-lock

* fix pipeline

* remove comments

* Address comments

* Address comments
This commit is contained in:
sunghyunkang1111
2024-05-20 13:30:30 -05:00
committed by GitHub
parent 4da3363cf7
commit ceeead8458
24 changed files with 297 additions and 36 deletions

View File

@@ -16,3 +16,7 @@ export const isServerlessAccount = (): boolean => {
isCapabilityEnabled(Constants.CapabilityNames.EnableServerless)
);
};
export const isVectorSearchEnabled = (): boolean => {
return userContext.apiType === "SQL" && isCapabilityEnabled(Constants.CapabilityNames.EnableNoSQLVectorSearch);
};

View File

@@ -9,7 +9,7 @@
import { configContext } from "../../../../ConfigContext";
import { armRequest } from "../../request";
import * as Types from "./types";
const apiVersion = "2024-02-15-preview";
const apiVersion = "2024-05-15-preview";
/* Lists the SQL databases under an existing Azure Cosmos DB database account. */
export async function listSqlDatabases(

View File

@@ -1235,6 +1235,9 @@ export interface SqlDatabaseResource {
export interface SqlContainerResource {
/* Name of the Cosmos DB SQL container */
id: string;
vectorEmbeddingPolicy?: VectorEmbeddingPolicy;
/* The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container */
indexingPolicy?: IndexingPolicy;
@@ -1267,6 +1270,17 @@ export interface SqlContainerResource {
computedProperties?: ComputedProperty[];
}
export interface VectorEmbeddingPolicy {
vectorEmbeddings: VectorEmbedding[];
}
export interface VectorEmbedding {
path?: string;
dataType?: string;
dimensions?: number;
distanceFunction?: string;
}
/* Cosmos DB indexing policy */
export interface IndexingPolicy {
/* Indicates if the indexing policy is automatic */
@@ -1285,6 +1299,13 @@ export interface IndexingPolicy {
/* List of spatial specifics */
spatialIndexes?: SpatialSpec[];
vectorIndexes?: VectorIndex[];
}
export interface VectorIndex {
path?: string;
type?: string;
}
/* undocumented */