Skip to content

Commit 3d4d2d9

Browse files
committed
requested changed from Heidi
1 parent f763fe0 commit 3d4d2d9

File tree

2 files changed

+49
-53
lines changed

2 files changed

+49
-53
lines changed

articles/search/includes/quickstarts/semantic-ranker-javascript.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
author: haileytap
2+
author: diberry
33
ms.author: haileytapia
44
ms.service: azure-ai-search
55
ms.custom:
@@ -65,7 +65,7 @@ If you signed in to the [Azure portal](https://portal.azure.com), you're signed
6565

6666
## Create a common authentication file
6767

68-
Create a file in `./src` called `config.js` to hold the environment variables and authentication credential. Copy in the following code. This file will be used by all the other files in this quickstart.
68+
Create a file in `./src` called `config.ts` to read the `.env` file and hold the environment variables and authentication credential. Copy in the following code; don't change it. This file will be used by all the other files in this quickstart.
6969
7070
```javascript
7171
import { DefaultAzureCredential } from "@azure/identity";
@@ -82,7 +82,7 @@ console.log(`Using Azure Search endpoint: ${searchEndpoint}`);
8282
console.log(`Using index name: ${indexName}\n\n`);
8383
```
8484
85-
## Get configuration for the index
85+
## Get the index schema
8686
8787
In this section, you get settings for the existing `hotels-sample-index` index on your search service.
8888
@@ -125,8 +125,6 @@ In this section, you get settings for the existing `hotels-sample-index` index o
125125
node -r dotenv/config src/getIndexSettings.js
126126
```
127127
128-
1. The output
129-
130128
1. Output is the name of the index, list of fields, and a statement indicating whether a semantic configuration exists. For the purposes of this quickstart, the message should say `No semantic configuration exists for this index`.
131129
132130
## Update the index with a semantic configuration
@@ -357,7 +355,7 @@ To produce a semantic answer, the question and answer must be closely aligned, a
357355
credential
358356
);
359357
360-
const results = await searchClient.search("walking distance to live music", {
358+
const results = await searchClient.search("What's a good hotel for people who like to read", {
361359
queryType: "semantic",
362360
semanticSearchOptions: {
363361
configurationName: semanticConfigurationName,
@@ -425,6 +423,6 @@ To produce a semantic answer, the question and answer must be closely aligned, a
425423
426424
```console
427425
Semantic answer result #1:
428-
Semantic Answer: All of the suites feature full-sized kitchens stocked with cookware, separate living and sleeping areas and sofa beds. Some of the larger rooms have fireplaces and patios or balconies. Experience real country hospitality in the heart of bustling Nashville. The most vibrant<em> music scene </em>in the world is<em> just outside your front door.</em>
429-
Semantic Answer Score: 0.9860000014305115
426+
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.
427+
Semantic Answer Score: 0.9829999804496765
430428
```

articles/search/includes/quickstarts/semantic-ranker-typescript.md

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
author: haileytap
2+
author: diberry
33
ms.author: haileytapia
44
ms.service: azure-ai-search
55
ms.custom:
@@ -109,45 +109,45 @@ If you signed in to the [Azure portal](https://portal.azure.com), you're signed
109109

110110
## Create a common authentication file
111111

112-
1. Create a file in `./src` called `config.ts` to hold the environment variables and authentication credential. Copy in the following code. This file will be used by all the other files in this quickstart.
113-
114-
```typescript
115-
import { DefaultAzureCredential } from "@azure/identity";
116-
117-
// Configuration - use environment variables
118-
export const searchEndpoint = process.env.AZURE_SEARCH_ENDPOINT || "PUT-YOUR-SEARCH-SERVICE-ENDPOINT-HERE";
119-
export const indexName = process.env.AZURE_SEARCH_INDEX_NAME || "hotels-sample-index";
120-
export const semanticConfigurationName = process.env.SEMANTIC_CONFIGURATION_NAME || "semantic-config";
121-
122-
// Create credential
123-
export const credential = new DefaultAzureCredential();
124-
125-
console.log(`Using Azure Search endpoint: ${searchEndpoint}`);
126-
console.log(`Using index name: ${indexName}\n\n`);
127-
128-
// Hotel document interface
129-
export interface HotelDocument {
130-
"@search.action"?: string;
131-
HotelId: string;
132-
HotelName: string;
133-
Description: string;
134-
Category: string;
135-
Tags: string[];
136-
ParkingIncluded: string;
137-
LastRenovationDate: string;
138-
Rating: number;
139-
Address: {
140-
StreetAddress: string;
141-
City: string;
142-
StateProvince: string;
143-
PostalCode: string;
144-
Country: string;
145-
};
146-
}
147-
```
148-
149-
150-
## Get configuration for the index
112+
Create a file in `./src` called `config.ts` to read the `.env` file and hold the environment variables and authentication credential. Copy in the following code; don't change it. This file will be used by all the other files in this quickstart.
113+
114+
```typescript
115+
import { DefaultAzureCredential } from "@azure/identity";
116+
117+
// Configuration - use environment variables
118+
export const searchEndpoint = process.env.AZURE_SEARCH_ENDPOINT || "PUT-YOUR-SEARCH-SERVICE-ENDPOINT-HERE";
119+
export const indexName = process.env.AZURE_SEARCH_INDEX_NAME || "hotels-sample-index";
120+
export const semanticConfigurationName = process.env.SEMANTIC_CONFIGURATION_NAME || "semantic-config";
121+
122+
// Create credential
123+
export const credential = new DefaultAzureCredential();
124+
125+
console.log(`Using Azure Search endpoint: ${searchEndpoint}`);
126+
console.log(`Using index name: ${indexName}\n\n`);
127+
128+
// Hotel document interface
129+
export interface HotelDocument {
130+
"@search.action"?: string;
131+
HotelId: string;
132+
HotelName: string;
133+
Description: string;
134+
Category: string;
135+
Tags: string[];
136+
ParkingIncluded: string;
137+
LastRenovationDate: string;
138+
Rating: number;
139+
Address: {
140+
StreetAddress: string;
141+
City: string;
142+
StateProvince: string;
143+
PostalCode: string;
144+
Country: string;
145+
};
146+
}
147+
```
148+
149+
150+
## Get the index schema
151151
152152
In this section, you get settings for the existing `hotels-sample-index` index on your search service.
153153
@@ -193,8 +193,6 @@ In this section, you get settings for the existing `hotels-sample-index` index o
193193
npm run build && node -r dotenv/config dist/getIndexSettings.js
194194
```
195195
196-
1. The output
197-
198196
1. Output is the name of the index, list of fields, and a statement indicating whether a semantic configuration exists. For the purposes of this quickstart, the message should say `No semantic configuration exists for this index`.
199197
200198
## Update the index with a semantic configuration
@@ -430,7 +428,7 @@ To produce a semantic answer, the question and answer must be closely aligned, a
430428
credential
431429
);
432430
433-
const results = await searchClient.search("walking distance to live music", {
431+
const results = await searchClient.search("What's a good hotel for people who like to read", {
434432
queryType: "semantic",
435433
semanticSearchOptions: {
436434
configurationName: semanticConfigurationName,
@@ -499,6 +497,6 @@ To produce a semantic answer, the question and answer must be closely aligned, a
499497
500498
```console
501499
Semantic answer result #1:
502-
Semantic Answer: All of the suites feature full-sized kitchens stocked with cookware, separate living and sleeping areas and sofa beds. Some of the larger rooms have fireplaces and patios or balconies. Experience real country hospitality in the heart of bustling Nashville. The most vibrant<em> music scene </em>in the world is<em> just outside your front door.</em>
503-
Semantic Answer Score: 0.9860000014305115
500+
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.
501+
Semantic Answer Score: 0.9829999804496765
504502
```

0 commit comments

Comments
 (0)