Skip to content

Commit 0e862ad

Browse files
committed
updated Cosmos DB NoSQL index policy
1 parent c77fa76 commit 0e862ad

File tree

2 files changed

+13
-591
lines changed

2 files changed

+13
-591
lines changed

Python/CosmosDB-NoSQL_VectorSearch/CosmosDB-NoSQL-Quickstart-RAG-Chatbot.ipynb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,25 @@
130130
" { \n",
131131
" \"path\":\"/\" + cosmos_vector_property,\n",
132132
" \"dataType\":\"float32\",\n",
133-
" \"distanceFunction\":\"dotproduct\",\n",
133+
" \"distanceFunction\":\"cosine\",\n",
134134
" \"dimensions\":openai_embeddings_dimensions\n",
135135
" }, \n",
136136
" ]\n",
137137
"}\n",
138138
"\n",
139139
"# Create the vector index policy to specify vector details\n",
140140
"indexing_policy = {\n",
141+
" \"includedPaths\": [ \n",
142+
" { \n",
143+
" \"path\": \"/*\" \n",
144+
" } \n",
145+
" ], \n",
146+
" \"excludedPaths\": [ \n",
147+
" { \n",
148+
" \"path\": \"/\\\"_etag\\\"/?\",\n",
149+
" \"path\": \"/\" + cosmos_vector_property + \"/*\",\n",
150+
" } \n",
151+
" ], \n",
141152
" \"vectorIndexes\": [ \n",
142153
" {\n",
143154
" \"path\": \"/\"+cosmos_vector_property, \n",
@@ -152,7 +163,7 @@
152163
" partition_key=PartitionKey(path='/id'), \n",
153164
" indexing_policy=indexing_policy,\n",
154165
" vector_embedding_policy=vector_embedding_policy,\n",
155-
" offer_throughput=10000) \n",
166+
" offer_throughput=1000) \n",
156167
" print('Container with id \\'{0}\\' created'.format(movies_container.id)) \n",
157168
"\n",
158169
"except exceptions.CosmosHttpResponseError: \n",

0 commit comments

Comments
 (0)