Skip to content

Commit 1f77706

Browse files
committed
Branding and clean up resources include
1 parent c8479cb commit 1f77706

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

articles/cosmos-db/quickstart-vector-store-nodejs.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Find the sample code with resource provisioning on [GitHub](https://github.com/A
3030
- An Azure subscription
3131
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn)
3232

33-
- An existing **Azure Cosmos DB for NoSQL** resource data plane access
33+
- An existing **Azure Cosmos DB** resource data plane access
3434
- If you don't have a resource, create a [new resource](https://portal.azure.com/#create/Microsoft.DocumentDB)
3535
- [Firewall configured to allow access to your client IP address](how-to-configure-firewall.md)
3636
- Role-based access control (RBAC) roles assigned:
@@ -116,7 +116,7 @@ Find the sample code with resource provisioning on [GitHub](https://github.com/A
116116

117117
Replace the placeholder values in the `.env` file with your own information:
118118
- `AZURE_OPENAI_EMBEDDING_ENDPOINT`: Your Azure OpenAI resource endpoint URL
119-
- `AZURE_COSMOSDB_ENDPOINT`: Your Cosmos DB endpoint URL
119+
- `AZURE_COSMOSDB_ENDPOINT`: Your Azure Cosmos DB endpoint URL
120120

121121
1. Add a `tsconfig.json` file to configure TypeScript:
122122

@@ -125,14 +125,14 @@ Find the sample code with resource provisioning on [GitHub](https://github.com/A
125125

126126
## Understand the document schema
127127

128-
Before building the application, understand how vectors are stored in Cosmos DB documents. Each hotel document contains:
128+
Before building the application, understand how vectors are stored in Azure Cosmos DB documents. Each hotel document contains:
129129

130130
- **Standard fields**: `HotelId`, `HotelName`, `Description`, `Category`, etc.
131131
- **Vector field**: `DescriptionVector` - an array of 1536 floating-point numbers representing the semantic meaning of the hotel description
132132

133133
Here's a simplified example of a hotel document structure:
134134
135-
```json
135+
```jsonc
136136
{
137137
"HotelId": "1",
138138
"HotelName": "Stay-Kay City Hotel",
@@ -155,7 +155,7 @@ Here's a simplified example of a hotel document structure:
155155
- **Indexing policy** creates a vector index on the vector field for efficient similarity search
156156
- The vector field should be **excluded from standard indexing** to optimize insertion performance
157157
158-
For more information on vector policies and indexing, see [Vector search in Azure Cosmos DB for NoSQL](./vector-search.md).
158+
For more information on vector policies and indexing, see [Vector search in Azure Cosmos DB](./vector-search.md).
159159
160160
## Create npm scripts
161161
@@ -203,7 +203,7 @@ Paste the following code into the `vector-search.ts` file.
203203
204204
:::code language="typescript" source="~/cosmos-db-vector-samples/nosql-vector-search-typescript/src/vector-search.ts" :::
205205
206-
This code configures either a `DiskANN` or `quantizedFlat` vector algorithm from environment variables, connects to Azure OpenAI and Cosmos DB using passwordless authentication, loads pre-vectorized hotel data from a JSON file, inserts it into the appropriate container, then generates an embedding for a natural-language query (`quintessential lodging near running trails, eateries, retail`) and executes a VectorDistance SQL query to retrieve the top 5 most semantically similar hotels ranked by similarity score.
206+
This code configures either a `DiskANN` or `quantizedFlat` vector algorithm from environment variables, connects to Azure OpenAI and Azure Cosmos DB using passwordless authentication, loads pre-vectorized hotel data from a JSON file, inserts it into the appropriate container, then generates an embedding for a natural-language query (`quintessential lodging near running trails, eateries, retail`) and executes a VectorDistance SQL query to retrieve the top 5 most semantically similar hotels ranked by similarity score.
207207
208208
Error handling covers missing clients, invalid algorithm selection, and non-existent containers/databases.
209209
@@ -220,7 +220,7 @@ const createEmbeddedForQueryResponse = await aiClient.embeddings.create({
220220
221221
This OpenAI API call for [client.embeddings.create](https://platform.openai.com/docs/guides/embeddings#how-to-get-embeddings) converts text like "quintessential lodging near running trails" into a 1536-dimension vector that captures its semantic meaning. For more details on generating embeddings, see [Azure OpenAI embeddings documentation](/azure/ai-foundry/openai/how-to/embeddings).
222222
223-
## Understand the code: Store vectors in Cosmos DB
223+
## Understand the code: Store vectors in Azure Cosmos DB
224224
225225
All documents with vector arrays are inserted at scale using the [`executeBulkOperations`](/javascript/api/%40azure/cosmos/items#@azure-cosmos-items-executebulkoperations) function:
226226
@@ -267,7 +267,7 @@ Paste the following code into `utils.ts`:
267267
This utility module provides these **key** functions:
268268
269269
- `getClientsPasswordless`: Creates and returns clients for Azure OpenAI and Azure Cosmos DB using passwordless authentication. Enable RBAC on both resources and sign in to Azure CLI
270-
- `insertData`: Inserts data in batches into a Cosmos DB container and creates standard indexes on specified fields
270+
- `insertData`: Inserts data in batches into an Azure Cosmos DB container and creates standard indexes on specified fields
271271
- `printSearchResults`: Prints the results of a vector search, including the score and hotel name
272272
- `validateFieldName`: Validates that a field name exists in the data
273273
- `getBulkOperationRUs`: Estimates the Request Units (RUs) for bulk operations based on the number of documents and vector dimensions
@@ -321,7 +321,7 @@ The app logging and output show:
321321
322322
## Distance metrics
323323
324-
Azure Cosmos DB for NoSQL supports three distance functions for vector similarity:
324+
Azure Cosmos DB supports three distance functions for vector similarity:
325325
326326
| Distance Function | Score Range | Interpretation | Best For |
327327
|------------------|-------------|----------------|----------|
@@ -450,7 +450,7 @@ For detailed information on distance functions, see [What are distance functions
450450
451451
## Clean up resources
452452
453-
Delete the resource group, Cosmos DB account, and Azure OpenAI resource when you don't need them to avoid extra costs.
453+
[!INCLUDE [Clean up resources](./includes/clean-up-resources.md)]
454454
455455
## Related content
456456

0 commit comments

Comments
 (0)