Skip to content

Commit c2a28c9

Browse files
authored
Minor change in the sample (Azure#9373)
* Minor change in the sample * Additional changes
1 parent 0d156aa commit c2a28c9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

sdk/search/search-documents/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const client = new SearchClient(
103103

104104
async function main() {
105105
// Let's get the top 5 jobs related to Microsoft
106-
const searchResults = await client.search({ searchText: "Microsoft", top: 5 });
106+
const searchResults = await client.search("Microsoft", { top: 5 });
107107
for await (const result of searchResults.results) {
108108
console.log(`${result.business_title}\n${result.job_description}\n`);
109109
}

sdk/search/search-documents/samples/javascript/readonlyQuery.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ async function main() {
2121
const credential = new AzureKeyCredential(apiKey);
2222
const client = new SearchClient(endpoint, indexName, credential);
2323

24-
const count = await client.countDocuments();
24+
const count = await client.getDocumentsCount();
2525
console.log(`${count} documents in index ${client.indexName}`);
2626

2727
const state = "FL";
2828
const country = "USA";
29-
const searchResults = await client.search({
30-
searchText: "WiFi",
29+
const searchResults = await client.search(
30+
"WiFi",
31+
{
3132
filter: odata`Address/StateProvince eq ${state} and Address/Country eq ${country}`,
3233
orderBy: ["Rating desc"],
3334
select: ["HotelId", "HotelName", "Rating"]

sdk/search/search-documents/samples/typescript/src/readonlyQuery.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,12 @@ export async function main() {
5151
const credential = new AzureKeyCredential(apiKey);
5252
const client = new SearchClient<Hotel>(endpoint, indexName, credential);
5353

54-
const count = await client.countDocuments();
54+
const count = await client.getDocumentsCount();
5555
console.log(`${count} documents in index ${client.indexName}`);
5656

5757
const state = "FL";
5858
const country = "USA";
59-
const searchResults = await client.search({
60-
searchText: "WiFi",
59+
const searchResults = await client.search("WiFi", {
6160
filter: odata`Address/StateProvince eq ${state} and Address/Country eq ${country}`,
6261
orderBy: ["Rating desc"],
6362
select: ["HotelId", "HotelName", "Rating"]

0 commit comments

Comments
 (0)