Skip to content

Commit

Permalink
Remove Samples and Readme References with apiKeys (Azure#14072)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangan12 authored Mar 3, 2021
1 parent 719c3f8 commit 2d64abe
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 147 deletions.
31 changes: 0 additions & 31 deletions sdk/search/search-documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,37 +85,6 @@ const indexClient = new SearchIndexClient("<endpoint>", new AzureKeyCredential("
const indexerClient = new SearchIndexerClient("<endpoint>", new AzureKeyCredential("<apiKey>"));
```

### Send your first search query

To get running immediately, we're going to connect to a well known sandbox Search service provided by Microsoft. This means you do not need an Azure subscription or Azure Cognitive Search service to try out this query.

```js
const { SearchClient, AzureKeyCredential } = require("@azure/search-documents");

// We'll connect to the Azure Cognitive Search public sandbox and send a
// query to its "nycjobs" index built from a public dataset of available jobs
// in New York.
const indexName = "nycjobs";
const apiKey = "252044BE3886FE4A8E3BAA4F595114BB";

// Create a SearchClient to send queries
const client = new SearchClient(
`https://azs-playground.search.windows.net/`,
indexName,
new AzureKeyCredential(apiKey)
);

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

main();
```

## Key concepts
An Azure Cognitive Search service contains one or more indexes that provide persistent storage of searchable data in the form of JSON documents. _(If you're brand new to search, you can make a very rough analogy between indexes and database tables.)_ The @azure/search-documents client library
exposes operations on these resources through three main client types.
Expand Down
1 change: 0 additions & 1 deletion sdk/search/search-documents/samples/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ These sample programs show how to use the JavaScript client libraries for Azure

| **File Name** | **Description** |
| ---------------------------- | ------------------------ |
| [readonlyQuery.js][readonly] | queries a public dataset |
| **Data Source Connections** |
| [createDataSourceConnection.js][createDataSourceConnection] | Creates a Datasource Connection |
| [createOrUpdateDataSourceConnection.js][createOrUpdateDataSourceConnection] | Updates a Datasource Connection |
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion sdk/search/search-documents/samples/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ These sample programs show how to use the TypeScript client libraries for Azure

| **File Name** | **Description** |
| ---------------------------- | ------------------------ |
| [readonlyQuery.ts][readonly] | queries a public dataset |
| **Data Source Connections** |
| [createDataSourceConnection.ts][createDataSourceConnection] | Creates a Datasource Connection |
| [createOrUpdateDataSourceConnection.ts][createOrUpdateDataSourceConnection] | Updates a Datasource Connection |
Expand Down

This file was deleted.

0 comments on commit 2d64abe

Please sign in to comment.