Skip to content

Commit 5827cd1

Browse files
committed
QS fix for vectors array
1 parent 31811ac commit 5827cd1

File tree

1 file changed

+97
-83
lines changed

1 file changed

+97
-83
lines changed

articles/search/search-get-started-vector.md

Lines changed: 97 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: HeidiSteen
77
ms.author: heidist
88
ms.service: cognitive-search
99
ms.topic: quickstart
10-
ms.date: 06/29/2023
10+
ms.date: 07/07/2023
1111
---
1212

1313
# Quickstart: Use preview REST APIs for vector search queries
@@ -255,17 +255,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
255255
Content-Type: application/json
256256
api-key: {{admin-api-key}}
257257
{
258-
"vector": {
259-
"value": [
260-
-0.009154141,
261-
0.018708462,
262-
. . .
263-
-0.02178128,
264-
-0.00086512347
265-
],
266-
"fields": "contentVector",
267-
"k": 5
268-
}
258+
"vectors": [
259+
{
260+
"value": [
261+
-0.009154141,
262+
0.018708462,
263+
. . .
264+
-0.02178128,
265+
-0.00086512347
266+
],
267+
"fields": "contentVector",
268+
"k": 5
269+
}
270+
]
269271
}
270272
```
271273

@@ -282,46 +284,51 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
282284
Content-Type: application/json
283285
api-key: {{admin-api-key}}
284286
{
285-
"vector": {
286-
"value": [
287-
-0.009154141,
288-
0.018708462,
289-
. . .
290-
-0.02178128,
291-
-0.00086512347
292-
],
293-
"fields": "contentVector",
294-
"select": "title, content, category"
295-
"k": 10
296-
},
287+
"vector": [
288+
{
289+
"value": [
290+
-0.009154141,
291+
0.018708462,
292+
. . .
293+
-0.02178128,
294+
-0.00086512347
295+
],
296+
"fields": "contentVector",
297+
"select": "title, content, category"
298+
"k": 10
299+
},
300+
],
297301
"filter": "category eq 'Databases'"
298302
}
299303
```
300304

301-
302305
### Cross-field vector search
306+
303307
Cross-field vector search allows you to send a single query across multiple vector fields in your vector index. For this example, I want to calculate the similarity across both `titleVector` and `contentVector`:
304308

305309
```http
306310
POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/docs/search?api-version={{api-version}}
307311
Content-Type: application/json
308312
api-key: {{admin-api-key}}
309313
{
310-
"vector": {
311-
"value": [
312-
-0.009154141,
313-
0.018708462,
314-
. . .
315-
-0.02178128,
316-
-0.00086512347
317-
],
318-
"fields": "titleVector, contentVector",
319-
"k": 5
320-
}
314+
"vector": [
315+
{
316+
"value": [
317+
-0.009154141,
318+
0.018708462,
319+
. . .
320+
-0.02178128,
321+
-0.00086512347
322+
],
323+
"fields": "titleVector, contentVector",
324+
"k": 5
325+
}
326+
]
321327
}
322328
```
323329

324330
### Multi-query vector search
331+
325332
Multi-query vector search allows you to send a multiple queries across multiple vector fields in your vector index. For this example, I want to calculate the similarity across both `titleVector` and `contentVector` but will send in two different query embeddings respectively. This scenario is ideal for multi-modal use cases where you want to search over a `textVector` field and an `imageVector` field. You can also use this scenario if you have different embedding models with different dimensions in your search index.
326333

327334
```http
@@ -367,17 +374,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
367374
Content-Type: application/json
368375
api-key: {{admin-api-key}}
369376
{
370-
"vector": {
371-
"value": [
372-
-0.009154141,
373-
0.018708462,
374-
. . .
375-
-0.02178128,
376-
-0.00086512347
377-
],
378-
"fields": "contentVector",
379-
"k": 10
380-
},
377+
"vectors": [
378+
{
379+
"value": [
380+
-0.009154141,
381+
0.018708462,
382+
. . .
383+
-0.02178128,
384+
-0.00086512347
385+
],
386+
"fields": "contentVector",
387+
"k": 10
388+
}
389+
],
381390
"search": "what azure services support full text search",
382391
"top": "10"
383392
}
@@ -387,7 +396,7 @@ Compare the responses between Single Vector Search and Simple Hybrid Search for
387396

388397
**Single Vector Search**: Results ordered by cosine similarity (default vector similarity distance function)
389398

390-
```
399+
```json
391400
{
392401
"@search.score": 0.8851871,
393402
"title": "Azure Cognitive Search",
@@ -398,7 +407,7 @@ Compare the responses between Single Vector Search and Simple Hybrid Search for
398407

399408
**Hybrid Search**: Combined keyword and vector search results using Reciprocal Rank Fusion.
400409

401-
```
410+
```json
402411
{
403412
"@search.score": 0.03333333507180214,
404413
"title": "Azure Cognitive Search",
@@ -416,17 +425,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
416425
Content-Type: application/json
417426
api-key: {{admin-api-key}}
418427
{
419-
"vector": {
420-
"value": [
421-
-0.009154141,
422-
0.018708462,
423-
. . .
424-
-0.02178128,
425-
-0.00086512347
426-
],
427-
"fields": "contentVector",
428-
"k": 10
429-
},
428+
"vectors": [
429+
{
430+
"value": [
431+
-0.009154141,
432+
0.018708462,
433+
. . .
434+
-0.02178128,
435+
-0.00086512347
436+
],
437+
"fields": "contentVector",
438+
"k": 10
439+
}
440+
],
430441
"search": "what azure services support full text search",
431442
"filter": "category eq 'Databases'",
432443
"top": "10"
@@ -442,17 +453,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
442453
Content-Type: application/json
443454
api-key: {{admin-api-key}}
444455
{
445-
"vector": {
446-
"value": [
447-
-0.009154141,
448-
0.018708462,
449-
. . .
450-
-0.02178128,
451-
-0.00086512347
452-
],
453-
"fields": "contentVector",
454-
"k": 10
455-
},
456+
"vectors": [
457+
{
458+
"value": [
459+
-0.009154141,
460+
0.018708462,
461+
. . .
462+
-0.02178128,
463+
-0.00086512347
464+
],
465+
"fields": "contentVector",
466+
"k": 10
467+
}
468+
],
456469
"search": "what azure services support full text search",
457470
"select": "title, content, category",
458471
"queryType": "semantic",
@@ -473,17 +486,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
473486
Content-Type: application/json
474487
api-key: {{admin-api-key}}
475488
{
476-
"vector": {
477-
"value": [
478-
-0.009154141,
479-
0.018708462,
480-
. . .
481-
-0.02178128,
482-
-0.00086512347
483-
],
484-
"fields": "contentVector",
485-
"k": 10
486-
},
489+
"vectors": [
490+
{
491+
"value": [
492+
-0.009154141,
493+
0.018708462,
494+
. . .
495+
-0.02178128,
496+
-0.00086512347
497+
],
498+
"fields": "contentVector",
499+
"k": 10
500+
}
501+
],
487502
"search": "what azure services support full text search",
488503
"select": "title, content, category",
489504
"queryType": "semantic",
@@ -509,4 +524,3 @@ Azure Cognitive Search is a billable resource. If it's no longer needed, delete
509524
## Next steps
510525

511526
As a next step, we recommend reviewing the demo code for [Python](https://github.com/Azure/cognitive-search-vector-pr/tree/main/demo-python), or [C#](https://github.com/Azure/cognitive-search-vector-pr/tree/main/demo-dotnet).
512-

0 commit comments

Comments
 (0)