Skip to content

Commit 09983d9

Browse files
committed
Implemented acrolinx suggestions
1 parent c95e452 commit 09983d9

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/search/search-get-started-javascript.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@ Before you begin, have the following tools and services:
3232

3333
+ An Azure Cognitive Search service. [Create a service](search-create-service-portal.md) or [find an existing service](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices). You can use a free service for this quickstart.
3434

35-
+ [Node.js](https://nodejs.org) and [NPM](https://www.npmjs.com)
35+
+ [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com)
3636

3737
+ [Visual Studio Code](https://code.visualstudio.com) or another IDE
3838

3939
## Set up your project
4040

41-
Start by getting the endpoint and key for your search service. Then create a new project with NPM as outlined below.
41+
Start by getting the endpoint and key for your search service. Then create a new project with npm as outlined below.
4242

4343
<a name="get-service-info"></a>
4444

4545
### Copy a key and endpoint
4646

47-
Calls to the service require a URL endpoint and an access key on every request. As a first step, find the API key and URL to add to your project. You will specify both values when creating the client in a later step.
47+
Calls to the service require a URL endpoint and an access key on every request. As a first step, find the API key and URL to add to your project. You'll specify both values when creating the client in a later step.
4848

4949
1. [Sign in to the Azure portal](https://portal.azure.com/), and in your search service **Overview** page, get the URL. An example endpoint might look like `https://mydemo.search.windows.net`.
5050

51-
2. In **Settings** > **Keys**, get an admin key for full rights on the service, required if you are creating or deleting objects. There are two interchangeable primary and secondary keys. You can use either one.
51+
2. In **Settings** > **Keys**, get an admin key for full rights on the service, required if you're creating or deleting objects. There are two interchangeable primary and secondary keys. You can use either one.
5252

5353
![Get an HTTP endpoint and access key](media/search-get-started-rest/get-url-key.png "Get an HTTP endpoint and access key")
5454

5555
All requests require an api-key on every request sent to your service. Having a valid key establishes trust, on a per request basis, between the application sending the request and the service that handles it.
5656

57-
### Create a new NPM project
57+
### Create a new npm project
5858

5959
Begin by opening VS Code and its [integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal) or another terminal such as the Node.js command prompt.
6060

@@ -65,7 +65,7 @@ Begin by opening VS Code and its [integrated terminal](https://code.visualstudio
6565
cd quickstart
6666
```
6767
68-
2. Initialize an empty project with NPM by running the following command. To fully initialize the project, press Enter multiple times to accept the default values, except for the License, which you should set to "MIT".
68+
2. Initialize an empty project with npm by running the following command. To fully initialize the project, press Enter multiple times to accept the default values, except for the License, which you should set to "MIT".
6969
7070
```cmd
7171
npm init
@@ -163,7 +163,7 @@ With that in place, we're ready to create an index.
163163

164164
Create a file **hotels_quickstart_index.json**. This file defines how Azure Cognitive Search works with the documents you'll be loading in the next step. Each field will be identified by a `name` and have a specified `type`. Each field also has a series of index attributes that specify whether Azure Cognitive Search can search, filter, sort, and facet upon the field. Most of the fields are simple data types, but some, like `AddressType` are complex types that allow you to create rich data structures in your index. You can read more about [supported data types](/rest/api/searchservice/supported-data-types) and index attributes described in [Create Index (REST)](/rest/api/searchservice/create-index).
165165

166-
Add the following to **hotels_quickstart_index.json** or [download the file](https://github.com/Azure-Samples/azure-search-javascript-samples/blob/master/quickstart/v11/hotels_quickstart_index.json).
166+
Add the following content to **hotels_quickstart_index.json** or [download the file](https://github.com/Azure-Samples/azure-search-javascript-samples/blob/master/quickstart/v11/hotels_quickstart_index.json).
167167

168168
```json
169169
{
@@ -309,7 +309,7 @@ Within the main function, we then create a `SearchIndexClient`, which is used to
309309
const indexClient = new SearchIndexClient(endpoint, new AzureKeyCredential(apiKey));
310310
```
311311

312-
Next, we want to delete the index if it already exists. This is a common practice for test/demo code.
312+
Next, we want to delete the index if it already exists. This operation is a common practice for test/demo code.
313313

314314
We do this by defining a simple function that tries to delete the index.
315315

@@ -354,7 +354,7 @@ If you [downloaded the source code](https://github.com/Azure-Samples/azure-searc
354354

355355
You should see a series of messages describing the actions being taken by the program.
356356

357-
Open the **Overview** of your search service in the Azure portal. Select the **Indexes** tab. You should see something like the following:
357+
Open the **Overview** of your search service in the Azure portal. Select the **Indexes** tab. You should see something like the following example:
358358

359359
:::image type="content" source="media/search-get-started-javascript/create-index-no-data.png" alt-text="Screenshot of Azure portal, search service Overview, Indexes tab" border="false":::
360360

@@ -502,7 +502,7 @@ The queries are written in a `sendQueries()` function that we'll call in the mai
502502
await sendQueries(searchClient);
503503
```
504504

505-
Queries are sent using the `search()` method of `searchClient`. The first parameter is the search text and the second parameter is any additional search options.
505+
Queries are sent using the `search()` method of `searchClient`. The first parameter is the search text and the second parameter specifies search options.
506506

507507
The first query searches `*`, which is equivalent to searching everything and selects three of the fields in the index. It's a best practice to only `select` the fields you need because pulling back unnecessary data can add latency to your queries.
508508

@@ -526,7 +526,7 @@ async function sendQueries(searchClient) {
526526
}
527527
```
528528

529-
The remaining queries outlined below should also be added to the `sendQueries()` function. They are separated here for readability.
529+
The remaining queries outlined below should also be added to the `sendQueries()` function. They're separated here for readability.
530530

531531
In the next query, we specify the search term `"wifi"` and also include a filter to only return results where the state is equal to `'FL'`. Results are also ordered by the Hotel's `Rating`.
532532

@@ -545,7 +545,7 @@ for await (const result of searchResults.results) {
545545
}
546546
```
547547

548-
Next, the search is limited to a single searchable field using the `searchFields` parameter. This is a great option to make your query more efficient if you know you're only interested in matches in certain fields.
548+
Next, the search is limited to a single searchable field using the `searchFields` parameter. This approach is a great option to make your query more efficient if you know you're only interested in matches in certain fields.
549549

550550
```javascript
551551
console.log('Query #3 - Limit searchFields:');
@@ -595,7 +595,7 @@ When you're working in your own subscription, it's a good idea at the end of a p
595595

596596
You can find and manage resources in the portal, using the **All resources** or **Resource groups** link in the left-navigation pane.
597597

598-
If you are using a free service, remember that you are limited to three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
598+
If you're using a free service, remember the limit of three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
599599

600600
## Next steps
601601

0 commit comments

Comments
 (0)