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/search/search-get-started-vector.md
+97-83Lines changed: 97 additions & 83 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ author: HeidiSteen
7
7
ms.author: heidist
8
8
ms.service: cognitive-search
9
9
ms.topic: quickstart
10
-
ms.date: 06/29/2023
10
+
ms.date: 07/07/2023
11
11
---
12
12
13
13
# 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
255
255
Content-Type: application/json
256
256
api-key: {{admin-api-key}}
257
257
{
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
+
]
269
271
}
270
272
```
271
273
@@ -282,46 +284,51 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
282
284
Content-Type: application/json
283
285
api-key: {{admin-api-key}}
284
286
{
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
+
],
297
301
"filter": "category eq 'Databases'"
298
302
}
299
303
```
300
304
301
-
302
305
### Cross-field vector search
306
+
303
307
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`:
304
308
305
309
```http
306
310
POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/docs/search?api-version={{api-version}}
307
311
Content-Type: application/json
308
312
api-key: {{admin-api-key}}
309
313
{
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
+
]
321
327
}
322
328
```
323
329
324
330
### Multi-query vector search
331
+
325
332
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.
326
333
327
334
```http
@@ -367,17 +374,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
367
374
Content-Type: application/json
368
375
api-key: {{admin-api-key}}
369
376
{
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
+
],
381
390
"search": "what azure services support full text search",
382
391
"top": "10"
383
392
}
@@ -387,7 +396,7 @@ Compare the responses between Single Vector Search and Simple Hybrid Search for
@@ -398,7 +407,7 @@ Compare the responses between Single Vector Search and Simple Hybrid Search for
398
407
399
408
**Hybrid Search**: Combined keyword and vector search results using Reciprocal Rank Fusion.
400
409
401
-
```
410
+
```json
402
411
{
403
412
"@search.score": 0.03333333507180214,
404
413
"title": "Azure Cognitive Search",
@@ -416,17 +425,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
416
425
Content-Type: application/json
417
426
api-key: {{admin-api-key}}
418
427
{
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
+
],
430
441
"search": "what azure services support full text search",
431
442
"filter": "category eq 'Databases'",
432
443
"top": "10"
@@ -442,17 +453,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
442
453
Content-Type: application/json
443
454
api-key: {{admin-api-key}}
444
455
{
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
+
],
456
469
"search": "what azure services support full text search",
457
470
"select": "title, content, category",
458
471
"queryType": "semantic",
@@ -473,17 +486,19 @@ POST https://{{search-service-name}}.search.windows.net/indexes/{{index-name}}/d
473
486
Content-Type: application/json
474
487
api-key: {{admin-api-key}}
475
488
{
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
+
],
487
502
"search": "what azure services support full text search",
488
503
"select": "title, content, category",
489
504
"queryType": "semantic",
@@ -509,4 +524,3 @@ Azure Cognitive Search is a billable resource. If it's no longer needed, delete
509
524
## Next steps
510
525
511
526
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).
0 commit comments