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
+34-31Lines changed: 34 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ In Azure AI Search, a [vector store](../../vector-store.md) has an index schema
19
19
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
20
20
21
21
- An Azure AI Search service. [Create a service](../../search-create-service-portal.md) or [find an existing service](https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/CognitiveSearch) in your current subscription.
22
+
- The `Search Index Data Contributor` role assigned at the scope of the service.
22
23
- You can use a free search service for most of this quickstart, but we recommend the Basic tier or higher for larger data files.
23
24
- To run the query example that invokes [semantic reranking](../../semantic-search-overview.md), your search service must be at the Basic tier or higher with [semantic ranker enabled](../../semantic-how-to-enable-disable.md).
24
25
@@ -111,14 +112,14 @@ In this section, you create a vector index in Azure AI Search with [SearchIndexC
111
112
112
113
1. Run the file:
113
114
114
-
```console
115
+
```bash
115
116
node -r dotenv/config src/createIndex.js
116
117
```
117
118
1. The output of this code shows that the index is created successfully:
118
119
119
-
```console
120
-
Using Azure Search endpoint: https://my-service.search.windows.net
121
-
Using index name: hotels-vector-quickstart
120
+
```output
121
+
Using Azure Search endpoint: https://<search-service-name>.search.windows.net
122
+
Using Azure Search index: <vector-index-name>
122
123
Creating index...
123
124
hotels-vector-quickstart created
124
125
```
@@ -142,7 +143,7 @@ Creating and loading the index are separate steps. You created the index schema
142
143
143
144
In Azure AI Search, the index stores all searchable content, while the search engine executes queries against that index.
144
145
145
-
1. Create a `uploadDocuments.js` file in the `src` directory.
146
+
1. Create an`uploadDocuments.js` file in the `src` directory.
@@ -153,12 +154,14 @@ In Azure AI Search, the index stores all searchable content, while the search en
153
154
154
155
1. Build and run the file:
155
156
156
-
```console
157
+
```bash
157
158
node -r dotenv/config src/uploadDocuments.js
158
159
```
159
160
1. The output of this code shows that the documents are indexed and ready for search:
160
161
161
-
```console
162
+
```output
163
+
Using Azure Search endpoint: https://<search-service-name>.search.windows.net
164
+
Using Azure Search index: <vector-index-name>
162
165
Uploading documents...
163
166
Key: 1, Succeeded: true, ErrorMessage: none
164
167
Key: 2, Succeeded: true, ErrorMessage: none
@@ -171,7 +174,7 @@ In Azure AI Search, the index stores all searchable content, while the search en
171
174
All documents indexed successfully.
172
175
```
173
176
174
-
Key takeaways about the upload_documents() method and this example:
177
+
Key takeaways about the uploadDocuments() method and this example:
175
178
176
179
* Your code interacts with a specific search index hosted in your Azure AI Search service through the SearchClient, which is the main object provided by the @azure/search-documents package. The SearchClient provides access to index operations such as:
177
180
* Data ingestion - uploadDocuments(), mergeDocuments(), deleteDocuments(), etc.
@@ -211,15 +214,15 @@ The first example demonstrates a basic scenario where you want to find document
211
214
212
215
1. Build and run the file:
213
216
214
-
```console
217
+
```bash
215
218
node -r dotenv/config src/searchSingle.js
216
219
```
217
220
218
221
1. The output of this code shows the relevant docs for the query `quintessential lodging near running trails, eateries, retail`.
219
222
220
-
```console
221
-
Using Azure Search endpoint: https://ai-search-dib-2.search.windows.net
222
-
Using index name: hotels-vector-quickstart-0627-4
223
+
```output
224
+
Using Azure Search endpoint: https://<search-service-name>.search.windows.net
225
+
Using Azure Search index: <vector-index-name>
223
226
224
227
225
228
Single Vector search found 5
@@ -247,14 +250,14 @@ You can add filters, but the filters are applied to the nonvector content in you
1. The output of this code shows the relevant documents for the hybrid search:
312
315
313
-
```console
314
-
Using Azure Search endpoint: https://ai-search-dib-2.search.windows.net
315
-
Using index name: hotels-vector-quickstart-0627-4
316
+
```output
317
+
Using Azure Search endpoint: https://<search-service-name>.search.windows.net
318
+
Using Azure Search index: <vector-index-name>
316
319
317
320
318
321
Hybrid search found 7 then limited to top 5
@@ -417,7 +420,7 @@ This search uses [SearchClient](/javascript/api/@azure/search-documents/searchcl
417
420
"@search.score": 0.8133763,
418
421
"HotelId": "3",
419
422
"HotelName": "Gastronomic Landscape Hotel",
420
-
"Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel’s restaurant services.",
423
+
"Description": "The Hotel stands out for its gastronomic excellence under the management of William Dough, who advises on and oversees all of the Hotel's restaurant services.",
421
424
"Category": "Resort and Spa"
422
425
}
423
426
]
@@ -436,15 +439,15 @@ This search uses [SearchClient](/javascript/api/@azure/search-documents/searchcl
436
439
437
440
1. Build and run the file:
438
441
439
-
```console
442
+
```bash
440
443
node -r dotenv/config src/searchSemanticHybrid.js
441
444
```
442
445
443
446
1. The output of this code shows the relevant documents for the semantic hybrid search:
444
447
445
-
```console
446
-
Using Azure Search endpoint: https://ai-search-dib-2.search.windows.net
447
-
Using index name: hotels-vector-quickstart-0627-4
448
+
```output
449
+
Using Azure Search endpoint: https://<search-service-name>.search.windows.net
450
+
Using Azure Search index: <vector-index-name>
448
451
449
452
450
453
Semantic hybrid search found 7 then limited to top 5
@@ -480,7 +483,7 @@ This search uses [SearchClient](/javascript/api/@azure/search-documents/searchcl
480
483
Re-ranker Score: 2.0582215785980225
481
484
HotelId: 3
482
485
HotelName: Gastronomic Landscape Hotel
483
-
Description: The Gastronomic Hotel stands out for its culinary excellence under the management of William Dough, who advises on and oversees all of the Hotel’s restaurant services.
486
+
Description: The Gastronomic Hotel stands out for its culinary excellence under the management of William Dough, who advises on and oversees all of the Hotel's restaurant services.
484
487
Category: Suite
485
488
```
486
489
@@ -509,7 +512,7 @@ If you want to keep the search service, but delete the index and documents, you
Copy file name to clipboardExpand all lines: articles/search/includes/quickstarts/semantic-ranker-java.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
@@ -89,7 +89,7 @@ If you signed in to the [Azure portal](https://portal.azure.com), you're signed
89
89
90
90
## Create a common configuration class
91
91
92
-
Create a file in`src/main/java/com/azure/search/quickstart` called `SearchConfig.java` to read the properties file and hold the environment variables and authentication credential.
92
+
Create a file in`src/main/java/com/azure/search/quickstart` called `SearchConfig.java` to read the properties file and hold the configuration values and authentication credential.
93
93
94
94
```java
95
95
package com.azure.search.quickstart;
@@ -476,7 +476,7 @@ Optionally, you can add captions to extract portions of the text and apply hit h
476
476
477
477
1. Output should include a new caption element alongside search field. Captions are the most relevant passages in a result. If your index includes larger chunks of text, a caption is helpful for extracting the most interesting sentences.
478
478
479
-
```console
479
+
```output
480
480
Search result #1:
481
481
Re-ranker Score: 2.613231658935547
482
482
HotelName: Uptown Chic Hotel
@@ -604,7 +604,7 @@ To produce a semantic answer, the question and answer must be closely aligned, a
604
604
605
605
Recall that answers are *verbatim content* pulled from your index and might be missing phrases that a user would expect to see. To get *composed answers* as generated by a chat completion model, considering using a [RAG pattern](../../retrieval-augmented-generation-overview.md) or [agentic retrieval](../../search-agentic-retrieval-concept.md).
606
606
607
-
```console
607
+
```output
608
608
Semantic answer result #1:
609
609
Semantic Answer: Nature is Home on the beach. Explore the shore by day, and then come home to our shared living space to relax around a stone fireplace, sip something warm, and explore the<em> library </em>by night. Save up to 30 percent. Valid Now through the end of the year. Restrictions and blackouts may apply.
0 commit comments