Skip to content

Commit 5f3e1ea

Browse files
Merge pull request #282699 from jcodella/patch-15
Update vector-search.md
2 parents 13ee701 + d516ba8 commit 5f3e1ea

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

articles/cosmos-db/nosql/vector-search.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ The container vector policy can be described as JSON objects. Here are two examp
137137
| **`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 |
138138
| **`diskANN`** | Creates an index based on DiskANN for fast and efficient approximate search. | 4096 |
139139

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+
140143
A few points to note:
141144
- 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.
142145

@@ -158,6 +161,9 @@ Here are examples of valid vector index policies:
158161
"excludedPaths": [
159162
{
160163
"path": "/_etag/?"
164+
},
165+
{
166+
"path": "/vector1"
161167
}
162168
],
163169
"vectorIndexes": [
@@ -181,6 +187,12 @@ Here are examples of valid vector index policies:
181187
"excludedPaths": [
182188
{
183189
"path": "/_etag/?"
190+
},
191+
{
192+
"path": "/vector1",
193+
},
194+
{
195+
"path": "/vector2",
184196
}
185197
],
186198
"vectorIndexes": [
@@ -195,12 +207,14 @@ Here are examples of valid vector index policies:
195207
]
196208
}
197209
```
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.
200213
201214
> [!IMPORTANT]
202215
> 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.
203216
217+
204218
## Perform vector search with queries using VectorDistance()
205219

206220
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

Comments
 (0)