Skip to content

Commit 5ee699a

Browse files
committed
paragraph to list
1 parent 5248082 commit 5ee699a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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](./vector-search.md).
158+
These policies are defined in the Bicep templates for the [distance metrics](#distance-metrics) for this sample project. For more information on vector policies and indexing, see [Vector search in Azure Cosmos DB](./vector-search.md).
159159
160160
## Create npm scripts
161161
@@ -165,7 +165,7 @@ Edit the `package.json` file and add these scripts:
165165
166166
Use these scripts to compile TypeScript files and run the DiskANN index implementation.
167167
168-
```json
168+
```jsonc
169169
"scripts": {
170170
"build": "tsc",
171171
"start:diskann": "cross-env VECTOR_ALGORITHM=diskann node --env-file .env dist/vector-search.js"
@@ -176,7 +176,7 @@ Use these scripts to compile TypeScript files and run the DiskANN index implemen
176176
177177
Use these scripts to compile TypeScript files and run the Quantized flat index implementation.
178178
179-
```json
179+
```jsonc
180180
"scripts": {
181181
"build": "tsc",
182182
"start:quantizedflat": "cross-env VECTOR_ALGORITHM=quantizedflat node --env-file .env dist/vector-search.js"
@@ -203,9 +203,15 @@ 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 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.
206+
This code:
207207
208-
Error handling covers missing clients, invalid algorithm selection, and non-existent containers/databases.
208+
- Configures either a `DiskANN` or `quantizedFlat` vector algorithm from environment variables.
209+
- Connects to Azure OpenAI and Azure Cosmos DB using passwordless authentication.
210+
- Loads pre-vectorized hotel data from a JSON file.
211+
- Inserts data into the appropriate container.
212+
- Generates an embedding for a natural-language query (`quintessential lodging near running trails, eateries, retail`).
213+
- Executes a `VectorDistance` SQL query to retrieve the top 5 most semantically similar hotels ranked by similarity score.
214+
- Handles errors for missing clients, invalid algorithm selection, and non-existent containers/databases.
209215
210216
## Understand the code: Generate embeddings with Azure OpenAI
211217

0 commit comments

Comments
 (0)