in src/WebJobs.Extensions.OpenAI.CosmosDBSearch/CosmosDBSearchProvider.cs [440:483]
BsonDocument GetIndexDefinitionVectorHNSW()
{
return new BsonDocument
{
{ "createIndexes", this.collectionName },
{
"indexes",
new BsonArray
{
new BsonDocument
{
{ "name", this.indexName },
{
"key",
new BsonDocument
{
{
this.cosmosDBSearchConfigOptions.Value.EmbeddingKey,
"cosmosSearch"
}
}
},
{
"cosmosSearchOptions",
new BsonDocument
{
{ "kind", this.cosmosDBSearchConfigOptions.Value.Kind },
{ "m", this.cosmosDBSearchConfigOptions.Value.NumberOfConnections },
{
"efConstruction",
this.cosmosDBSearchConfigOptions.Value.EfConstruction
},
{ "similarity", this.cosmosDBSearchConfigOptions.Value.Similarity },
{
"dimensions",
this.cosmosDBSearchConfigOptions.Value.VectorSearchDimensions
}
}
}
}
}
}
};
}