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
+14-10Lines changed: 14 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.service: azure-ai-search
8
8
ms.custom:
9
9
- ignite-2023
10
10
ms.topic: quickstart
11
-
ms.date: 06/12/2025
11
+
ms.date: 06/18/2025
12
12
---
13
13
14
14
# Quickstart: Vector search using REST
@@ -96,12 +96,11 @@ You use one `.rest` or `.http` file to run all the requests in this quickstart.
96
96
97
97
1. For the **recommended** keyless authentication via Microsoft Entra ID, you need to replace `api-key: {{apiKey}}` with `Authorization: Bearer {{token}}`in the request headers. Replace all instances of `api-key: {{apiKey}}` that you find in the file.
98
98
99
-
100
99
## Create a vector index
101
100
102
101
You use the [Create Index](/rest/api/searchservice/indexes/create) REST API to create a vector index and set up the physical data structures on your search service.
103
102
104
-
The index schema in this example is organized around hotel content. Sample data consists of vector and nonvector names and descriptions of fictitious hotels. This schema includes configurations for vector indexing and queries, and for semantic ranking.
103
+
The index schema in this example is organized around hotel content. Sample data consists of vector and nonvector descriptions of fictitious hotels. This schema includes configurations for vector indexing and queries, and for semantic ranking.
105
104
106
105
1. In Visual Studio Code, open the `az-search-vector-quickstart.rest` file you [created earlier](#create-or-download-the-code-file).
107
106
@@ -110,7 +109,7 @@ The index schema in this example is organized around hotel content. Sample data
110
109
111
110
```http
112
111
### Create a new index
113
-
POST {{baseUrl}}/indexes?api-version=2023-11-01 HTTP/1.1
112
+
POST {{baseUrl}}/indexes?api-version=2024-07-01 HTTP/1.1
114
113
Content-Type: application/json
115
114
Authorization: Bearer {{token}}
116
115
@@ -387,7 +386,7 @@ Key takeaways about the [Create Index](/rest/api/searchservice/indexes/create) R
387
386
388
387
- The `fields` collection includes a required key field and text and vector fields (such as `Description` and `DescriptionVector`) fortext and vector search. Colocating vector and nonvector fieldsin the same index enables hybrid queries. For instance, you can combine filters, text search with semantic ranking, and vectors into a single query operation.
389
388
390
-
- Vector fields must be `type: Collection(Edm.Single)` with`dimensions` and `vectorSearchProfile` properties.
389
+
- Vector fields must be one of the [EDM data types used for vectors](rest/api/searchservice/supported-data-types#edm-data-types-for-vector-fields), such as `type: Collection(Edm.Single)`. Vector fields also have`dimensions` and `vectorSearchProfile` properties.
391
390
392
391
- The `vectorSearch` section is an array of approximate nearest neighbor algorithm configurations and profiles. Supported algorithms include hierarchical navigable small world and exhaustive k-nearest neighbor. For more information, see [Relevance scoring in vector search](vector-search-ranking.md).
393
392
@@ -652,7 +651,7 @@ Key takeaways about the [Documents - Index REST API](/rest/api/searchservice/doc
652
651
653
652
## Run queries
654
653
655
-
Now that documents are loaded, you can issue vector queries against them by using [Documents - Search Post (REST)](/rest/api/searchservice/documents/search-post).
654
+
Now that documents are loaded, you can run vector queries against them by using [Documents - Search Post (REST)](/rest/api/searchservice/documents/search-post).
656
655
657
656
In the next sections, we run queries against the `hotels-vector-quickstart` index. The queries include:
658
657
@@ -661,7 +660,7 @@ In the next sections, we run queries against the `hotels-vector-quickstart` inde
The example vector queries are based on two strings:
663
+
The example queries are based on two strings:
665
664
666
665
- **Search string**: `historic hotel walk to restaurants and shopping`
667
666
- **Vector query string** (vectorized into a mathematical representation): `quintessential lodging near running trails, eateries, retail`
@@ -692,10 +691,15 @@ The vector query string is semantically similar to the search string, but it inc
692
691
]
693
692
}
694
693
```
694
+
Key takeaways about the [Documents - Search Post](/rest/api/searchservice/documents/search-post) REST API:
695
+
696
+
+ The `vectorQueries.vector` is the vector query string. It's a vector representation of *quintessential lodging near running trails, eateries, retail*, which is vectorized into 1,536 embeddings for this query.
697
+
698
+
+ `fields` determines which vector fields are searched.
695
699
696
-
The `vectorQueries.vector` contains the vectorized text of the query input, `fields` determines which vector fields are searched, and `k` specifies the number of nearest neighbors to return.
700
+
+ `kind` set to `vector` means that the query string is a vector. If `kind` was set to `text`, you would need extra capability (a [vectorizer]()) to encode a human readable text string into a vector at query time. Vectorizers are omitted from this quickstart to keep the exercise simple.
697
701
698
-
The query is a vector representation of *quintessential lodging near running trails, eateries, retail*, which is vectorized into 1,536 embeddings forthis query.
702
+
+ `k` specifies the number of nearest neighbors to return in the response. A `count` parameter specifies the number of matches found in the index. Including count is a best practice for queries, but it's less useful forsimilarity search where the algorithm can find some degree of similarityin almost any document.
699
703
700
704
1. Select **Send request**. You should have an `HTTP/1.1 200 OK` response. The response body should include the JSON representation of the search results.
701
705
@@ -838,7 +842,7 @@ You can add filters, but the filters are applied to the nonvector content in you
838
842
}
839
843
```
840
844
841
-
1. Here's another query that uses a geo-filter, limiting results to hotels within 500 kilometers around Washington D.C.
845
+
1. Here's another query that uses a geo-filter, limiting results to hotels within 300 kilometers around Washington D.C.
0 commit comments