You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/vector-search.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,9 @@ The container vector policy can be described as JSON objects. Here are two examp
137
137
|**`quantizedFlat`**| Quantizes (compresses) vectors before storing on the index. This can improve latency and throughput at the cost of a small amount of accuracy. | 4096 |
138
138
|**`diskANN`**| Creates an index based on DiskANN for fast and efficient approximate search. | 4096 |
139
139
140
+
> [!NOTE]
141
+
> The `quantizedFlat` and `diskANN` indexes requires that at least 1,000 vectors to be inserted. This is to ensure accuracy of the quantization process. If there are fewer than 1,000 vectors, a full scan is executed instead and will lead to higher RU charges for a vector search query.
142
+
140
143
A few points to note:
141
144
- The `flat` and `quantizedFlat` index types uses Azure Cosmos DB's index to store and read each vector when performing a vector search. Vector searches with a `flat` index are brute-force searches and produce 100% accuracy or recall. That is, it's guaranteed to find the most similar vectors in the dataset. However, there's a limitation of `505` dimensions for vectors on a flat index.
142
145
@@ -158,6 +161,9 @@ Here are examples of valid vector index policies:
158
161
"excludedPaths": [
159
162
{
160
163
"path": "/_etag/?"
164
+
},
165
+
{
166
+
"path": "/vector1"
161
167
}
162
168
],
163
169
"vectorIndexes": [
@@ -181,6 +187,12 @@ Here are examples of valid vector index policies:
181
187
"excludedPaths": [
182
188
{
183
189
"path": "/_etag/?"
190
+
},
191
+
{
192
+
"path": "/vector1",
193
+
},
194
+
{
195
+
"path": "/vector2",
184
196
}
185
197
],
186
198
"vectorIndexes": [
@@ -195,12 +207,14 @@ Here are examples of valid vector index policies:
195
207
]
196
208
}
197
209
```
198
-
> [!NOTE]
199
-
> The Quantized Flat and DiskANN indexes requires that at least 1,000 vectors to be inserted. This is to ensure accuracy of the quantization process. If there are fewer than 1,000 vectors, a full scan is executed instead, and will lead to higher RU charges for a vector search query.
210
+
211
+
>[!IMPORTANT]
212
+
> The vector path added to the "excludedPaths" section of the indexing policy to ensure optimized performance for insertion. Not adding the vector path to "excludedPaths" will result in higher RU charge and latency for vector insertions.
200
213
201
214
> [!IMPORTANT]
202
215
> At this time in the vector search preview do not use nested path or wild card characters in the path of the vector policy. Replace operations on the vector policy are currently not supported.
203
216
217
+
204
218
## Perform vector search with queries using VectorDistance()
205
219
206
220
Once you created a container with the desired vector policy, and inserted vector data into the container, you can conduct a vector search using the [Vector Distance](query/vectordistance.md) system function in a query. An example of a NoSQL query that projects the similarity score as the alias `SimilarityScore`, and sorts in order of most-similar to least-similar:
0 commit comments