|
130 | 130 | " { \n", |
131 | 131 | " \"path\":\"/\" + cosmos_vector_property,\n", |
132 | 132 | " \"dataType\":\"float32\",\n", |
133 | | - " \"distanceFunction\":\"dotproduct\",\n", |
| 133 | + " \"distanceFunction\":\"cosine\",\n", |
134 | 134 | " \"dimensions\":openai_embeddings_dimensions\n", |
135 | 135 | " }, \n", |
136 | 136 | " ]\n", |
137 | 137 | "}\n", |
138 | 138 | "\n", |
139 | 139 | "# Create the vector index policy to specify vector details\n", |
140 | 140 | "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", |
141 | 152 | " \"vectorIndexes\": [ \n", |
142 | 153 | " {\n", |
143 | 154 | " \"path\": \"/\"+cosmos_vector_property, \n", |
|
152 | 163 | " partition_key=PartitionKey(path='/id'), \n", |
153 | 164 | " indexing_policy=indexing_policy,\n", |
154 | 165 | " vector_embedding_policy=vector_embedding_policy,\n", |
155 | | - " offer_throughput=10000) \n", |
| 166 | + " offer_throughput=1000) \n", |
156 | 167 | " print('Container with id \\'{0}\\' created'.format(movies_container.id)) \n", |
157 | 168 | "\n", |
158 | 169 | "except exceptions.CosmosHttpResponseError: \n", |
|
0 commit comments