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/includes/quickstarts/search-get-started-vector-javascript.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ author: diberry
4
4
ms.author: haileytapia
5
5
ms.service: azure-ai-search
6
6
ms.topic: include
7
-
ms.date: 06/26/2025
7
+
ms.date: 06/30/2025
8
8
---
9
9
10
10
In this quickstart, you use JavaScript to create, load, and query vectors. The code examples perform these operations by using the [Azure AI Search client library](/javascript/api/overview/azure/search-documents-readme). The library provides an abstraction over the REST API for access to index operations such as data ingestion, search operations, and index management operations.
@@ -79,6 +79,12 @@ Set up project with Visual Studio Code and JavaScript.
1. Create a `src` directory in your project directory.
83
+
84
+
```bash
85
+
mkdir src
86
+
```
87
+
82
88
## Sign in to Azure
83
89
84
90
You're using Microsoft Entra ID and role assignments for the connection. Make sure you're logged in to the same tenant and subscription as Azure AI Search and Azure OpenAI. You can use the Azure CLI on the command line to show current properties, change properties, and to sign in. For more information, see [Connect without keys](../../search-get-started-rbac.md).
@@ -98,7 +104,7 @@ You should now be logged in to Azure from your local device.
98
104
99
105
## Create the vector index
100
106
101
-
In this section, you create a vector index in Azure AI Search with [SearchIndexClient](/javascript/api/@azure/search-documents/searchindexclient).[createOrUpdateIndex](/javascript/api/@azure/search-documents/searchindexclient#@azure-search-documents-searchindexclient-createorupdateindex). The index schema defines the fields, including the vector field `DescriptionVector`. Once the index is created, you upload documents to the index. The documents contain the vectorized version of the article's description, which enables similarity search based on meaning rather than exact keywords.
107
+
In this section, you create a vector index in Azure AI Search with [SearchIndexClient](/javascript/api/@azure/search-documents/searchindexclient).[createOrUpdateIndex](/javascript/api/@azure/search-documents/searchindexclient#@azure-search-documents-searchindexclient-createorupdateindex). The index schema defines the fields, including the vector field `DescriptionVector`.
102
108
103
109
1. Create a `createIndex.js` file in the `src` directory.
104
110
@@ -136,7 +142,7 @@ In this section, you create a vector index in Azure AI Search with [SearchIndexC
136
142
137
143
## Upload documents to the index
138
144
139
-
Creating and loading the index are separate steps. You created the index schema [in the previous step](#create-the-vector-index). Now you need to load documents into the index with [SearchClient](/javascript/api/@azure/search-documents/searchclient).[uploadDocuments](/javascript/api/%40azure/search-documents/searchclient#@azure-search-documents-searchclient-uploaddocuments).
145
+
Creating and loading the index are separate steps. You created the index schema [in the previous step](#create-the-vector-index). Now you need to load documents into the index with [SearchClient](/javascript/api/@azure/search-documents/searchclient).[uploadDocuments](/javascript/api/%40azure/search-documents/searchclient#@azure-search-documents-searchclient-uploaddocuments). The documents contain the vectorized version of the article's description, which enables similarity search based on meaning rather than exact keywords.
140
146
141
147
In Azure AI Search, the index stores all searchable content, while the search engine executes queries against that index.
142
148
@@ -190,7 +196,7 @@ The vector query string is semantically similar to the search string, but it inc
1. This code in the following sections to perform vector searches. The query vector is created using an embedding model from Azure OpenAI.
199
+
1. This code is used in the following sections to perform vector searches. The query vector is created using an embedding model from Azure OpenAI.
194
200
195
201
196
202
## Create a single vector search
@@ -360,7 +366,7 @@ This search uses [SearchClient](/javascript/api/@azure/search-documents/searchcl
360
366
"HotelName": "Luxury Lion Resort",
361
367
"Description": "Unmatched Luxury. Visit our downtown hotel to indulge in luxury accommodations. Moments from the stadium, we feature the best in comfort"
362
368
},
363
-
```
369
+
```
364
370
365
371
In the vector-only query, which uses HNSW for finding matches, the Sublime Palace Hotel drops to fourth position. Historic Lion, which was second in the full-text search and third in the vector search, doesn't experience the same range of fluctuation, so it appears as a top match in a homogenized result set.
Copy file name to clipboardExpand all lines: articles/search/includes/quickstarts/search-get-started-vector-typescript.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ author: diberry
4
4
ms.author: haileytapia
5
5
ms.service: azure-ai-search
6
6
ms.topic: include
7
-
ms.date: 06/26/2025
7
+
ms.date: 06/30/2025
8
8
---
9
9
10
10
In this quickstart, you use TypeScript to create, load, and query vectors. The code examples perform these operations by using the [Azure AI Search client library](/javascript/api/overview/azure/search-documents-readme). The library provides an abstraction over the REST API for access to index operations such as data ingestion, search operations, and index management operations.
@@ -232,7 +232,7 @@ The vector query string is semantically similar to the search string, but it inc
1. This code will be used in the following sections to perform vector searches. The query vector is created using an embedding model from Azure OpenAI.
235
+
1. This code is used in the following sections to perform vector searches. The query vector is created using an embedding model from Azure OpenAI.
236
236
237
237
238
238
## Create a single vector search
@@ -402,7 +402,7 @@ This search uses [SearchClient](/javascript/api/@azure/search-documents/searchcl
402
402
"HotelName": "Luxury Lion Resort",
403
403
"Description": "Unmatched Luxury. Visit our downtown hotel to indulge in luxury accommodations. Moments from the stadium, we feature the best in comfort"
404
404
},
405
-
```
405
+
```
406
406
407
407
In the vector-only query, which uses HNSW for finding matches, the Sublime Palace Hotel drops to fourth position. Historic Lion, which was second in the full-text search and third in the vector search, doesn't experience the same range of fluctuation, so it appears as a top match in a homogenized result set.
0 commit comments