Skip to content

Commit 681b963

Browse files
committed
Freshness pass on quickstart-tutorial docs
1 parent df3e854 commit 681b963

File tree

3 files changed

+41
-48
lines changed

3 files changed

+41
-48
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ ms.author: heidist
88
ms.service: cognitive-search
99
ms.devlang: csharp
1010
ms.topic: quickstart
11-
ms.date: 06/11/2021
11+
ms.date: 08/29/2022
1212
ms.custom: devx-track-csharp, mode-api
1313
---
1414
# Quickstart: Create a search index using the Azure.Search.Documents client library
1515

16-
Use the new [Azure.Search.Documents (version 11) client library](/dotnet/api/overview/azure/search.documents-readme) to create a .NET Core console application in C# that creates, loads, and queries a search index.
16+
Use the [Azure.Search.Documents (version 11) client library](/dotnet/api/overview/azure/search.documents-readme) to create a .NET Core console application in C# that creates, loads, and queries a search index.
1717

1818
You can [download the source code](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/quickstart/v11) to start with a finished project or follow the steps in this article to create your own.
1919

@@ -30,7 +30,7 @@ Before you begin, have the following tools and services:
3030

3131
+ [Visual Studio](https://visualstudio.microsoft.com/downloads/), any edition. Sample code was tested on the free Community edition of Visual Studio 2019.
3232

33-
When setting up your project, you will download the [Azure.Search.Documents NuGet package](https://www.nuget.org/packages/Azure.Search.Documents/).
33+
When setting up your project, you'll download the [Azure.Search.Documents NuGet package](https://www.nuget.org/packages/Azure.Search.Documents/).
3434

3535
Azure SDK for .NET conforms to [.NET Standard 2.0](/dotnet/standard/net-standard#net-implementation-support), which means .NET Framework 4.6.1 and .NET Core 2.0 as minimum requirements.
3636

@@ -42,11 +42,11 @@ Assemble service connection information, and then start Visual Studio to create
4242

4343
### Copy a key and endpoint
4444

45-
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.
45+
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.
4646

4747
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`.
4848

49-
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.
49+
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.
5050

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

@@ -60,11 +60,11 @@ After the project is created, add the client library. The [Azure.Search.Document
6060

6161
1. In **Tools** > **NuGet Package Manager**, select **Manage NuGet Packages for Solution...**.
6262

63-
1. Click **Browse**.
63+
1. Select **Browse**.
6464

6565
1. Search for `Azure.Search.Documents` and select version 11.0 or later.
6666

67-
1. Click **Install** on the right to add the assembly to your project and solution.
67+
1. Select **Install** on the right to add the assembly to your project and solution.
6868

6969
### Create a search client
7070

@@ -104,7 +104,7 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
104104

105105
1. Add an empty class definition to your project: **Hotel.cs**
106106

107-
1. Copy the following code into **Hotel.cs** to define the structure of a hotel document. Attributes on the field determine how it is used in an application. For example, the `IsFilterable` attribute must be assigned to every field that supports a filter expression.
107+
1. Copy the following code into **Hotel.cs** to define the structure of a hotel document. Attributes on the field determine how it's used in an application. For example, the `IsFilterable` attribute must be assigned to every field that supports a filter expression.
108108

109109
```csharp
110110
using System;
@@ -185,7 +185,7 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
185185
}
186186
```
187187

188-
1. Create two more classes: **Hotel.Methods.cs** and **Address.Methods.cs** for ToString() overrides. These classes are used to render search results in the console output. The contents of these classes are not provided in this article, but you can copy the code from [files in GitHub](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/quickstart/v11/AzureSearchQuickstart-v11).
188+
1. Create two more classes: **Hotel.Methods.cs** and **Address.Methods.cs** for ToString() overrides. These classes are used to render search results in the console output. The contents of these classes aren't provided in this article, but you can copy the code from [files in GitHub](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/master/quickstart/v11/AzureSearchQuickstart-v11).
189189

190190
1. In **Program.cs**, create a [SearchIndex](/dotnet/api/azure.search.documents.indexes.models.searchindex) object, and then call the [CreateIndex](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindex) method to express the index in your search service. The index also includes a [SearchSuggester](/dotnet/api/azure.search.documents.indexes.models.searchsuggester) to enable autocomplete on the specified fields.
191191

@@ -347,7 +347,7 @@ When uploading documents, you must use an [IndexDocumentsBatch](/dotnet/api/azur
347347

348348
You can get query results as soon as the first document is indexed, but actual testing of your index should wait until all documents are indexed.
349349

350-
This section adds two pieces of functionality: query logic, and results. For queries, use the [Search](/dotnet/api/azure.search.documents.searchclient.search) method. This method takes search text (the query string) as well as other [options](/dotnet/api/azure.search.documents.searchoptions).
350+
This section adds two pieces of functionality: query logic, and results. For queries, use the [Search](/dotnet/api/azure.search.documents.searchclient.search) method. This method takes search text (the query string) and other [options](/dotnet/api/azure.search.documents.searchoptions).
351351

352352
The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) class represents the results.
353353

@@ -392,7 +392,7 @@ The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) c
392392
WriteDocuments(response);
393393
```
394394

395-
1. In the second query, search on a term, add a filter that selects documents where Rating is greater than 4, and then sort by Rating in descending order. Filter is a boolean expression that is evaluated over [IsFilterable](/dotnet/api/azure.search.documents.indexes.models.searchfield.isfilterable) fields in an index. Filter queries either include or exclude values. As such, there is no relevance score associated with a filter query.
395+
1. In the second query, search on a term, add a filter that selects documents where Rating is greater than 4, and then sort by Rating in descending order. Filter is a boolean expression that is evaluated over [IsFilterable](/dotnet/api/azure.search.documents.indexes.models.searchfield.isfilterable) fields in an index. Filter queries either include or exclude values. As such, there's no relevance score associated with a filter query.
396396

397397
```csharp
398398
Console.WriteLine("Query #2: Search on 'hotels', filter on 'Rating gt 4', sort by Rating in descending order...\n");
@@ -483,7 +483,7 @@ The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) c
483483

484484
The previous queries show multiple [ways of matching terms in a query](search-query-overview.md#types-of-queries): full-text search, filters, and autocomplete.
485485

486-
Full text search and filters are performed using the [SearchClient.Search](/dotnet/api/azure.search.documents.searchclient.search) method. A search query can be passed in the `searchText` string, while a filter expression can be passed in the [Filter](/dotnet/api/azure.search.documents.searchoptions.filter) property of the [SearchOptions](/dotnet/api/azure.search.documents.searchoptions) class. To filter without searching, just pass `"*"` for the `searchText` parameter of the [Search](/dotnet/api/azure.search.documents.searchclient.search) method. To search without filtering, leave the `Filter` property unset, or do not pass in a `SearchOptions` instance at all.
486+
Full text search and filters are performed using the [SearchClient.Search](/dotnet/api/azure.search.documents.searchclient.search) method. A search query can be passed in the `searchText` string, while a filter expression can be passed in the [Filter](/dotnet/api/azure.search.documents.searchoptions.filter) property of the [SearchOptions](/dotnet/api/azure.search.documents.searchoptions) class. To filter without searching, just pass `"*"` for the `searchText` parameter of the [Search](/dotnet/api/azure.search.documents.searchclient.search) method. To search without filtering, leave the `Filter` property unset, or don't pass in a `SearchOptions` instance at all.
487487

488488
## Run the program
489489

@@ -497,7 +497,7 @@ When you're working in your own subscription, it's a good idea at the end of a p
497497

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

500-
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.
500+
If you're using a free service, remember that you're limited to three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
501501

502502
## Next steps
503503

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: heidist
88
ms.service: cognitive-search
99
ms.devlang: python
1010
ms.topic: quickstart
11-
ms.date: 06/11/2021
11+
ms.date: 08/29/2022
1212
ms.custom: devx-track-python, mode-api
1313
---
1414

@@ -30,9 +30,9 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
3030

3131
The following services and tools are required for this quickstart.
3232

33-
* [Anaconda 3.x](https://www.anaconda.com/distribution/#download-section), providing Python 3.x and Jupyter Notebook.
33+
* Visual Studio Code with the Python extension (or equivalent tool), with Python 3.7 or later
3434

35-
* [azure-search-documents package](https://pypi.org/project/azure-search-documents/)
35+
* [azure-search-documents package](https://pypi.org/project/azure-search-documents/) from the Azure SDK for Python
3636

3737
* [Create a search service](search-create-service-portal.md) or [find an existing service](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices) under your current subscription. You can use the Free tier for this quickstart.
3838

@@ -50,7 +50,7 @@ All requests require an api-key on every request sent to your service. Having a
5050

5151
## Connect to Azure Cognitive Search
5252

53-
In this task, start Jupyter Notebook and verify that you can connect to Azure Cognitive Search. You'll do this by requesting a list of indexes from your service. On Windows with Anaconda3, you can use Anaconda Navigator to launch a notebook.
53+
In this task, start Jupyter Notebook and verify that you can connect to Azure Cognitive Search. You'll do this step by requesting a list of indexes from your service.
5454

5555
1. Create a new Python3 notebook.
5656

@@ -75,10 +75,10 @@ In this task, start Jupyter Notebook and verify that you can connect to Azure Co
7575
)
7676
```
7777

78-
1. In the second cell, input the request elements that will be constants on every request. Provide your search service name, admin API key, and query API key, copied in a previous step. This cell also sets up the clients you will use for specific operations: [SearchIndexClient](/python/api/azure-search-documents/azure.search.documents.indexes.searchindexclient) to create an index, and [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) to query an index.
78+
1. In the second cell, input the request elements that will be constants on every request. Provide your search service name, admin API key, and query API key, copied in a previous step. This cell also sets up the clients you'll use for specific operations: [SearchIndexClient](/python/api/azure-search-documents/azure.search.documents.indexes.searchindexclient) to create an index, and [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) to query an index.
7979

8080
```python
81-
service_name = "YOUR-SEARCH-SERIVCE-NAME"
81+
service_name = "YOUR-SEARCH-SERVICE-NAME"
8282
admin_key = "YOUR-SEARCH-SERVICE-ADMIN-API-KEY"
8383

8484
index_name = "hotels-quickstart"
@@ -110,7 +110,7 @@ In this task, start Jupyter Notebook and verify that you can connect to Azure Co
110110

111111
Required elements of an index include a name, a fields collection, and a key. The fields collection defines the structure of a logical *search document*, used for both loading data and returning results.
112112

113-
Each field has a name, type, and attributes that determine how the field is used (for example, whether it is full-text searchable, filterable, or retrievable in search results). Within an index, one of the fields of type `Edm.String` must be designated as the *key* for document identity.
113+
Each field has a name, type, and attributes that determine how the field is used (for example, whether it's full-text searchable, filterable, or retrievable in search results). Within an index, one of the fields of type `Edm.String` must be designated as the *key* for document identity.
114114

115115
This index is named "hotels-quickstart" and has the field definitions you see below. It's a subset of a larger [Hotels index](https://github.com/Azure-Samples/azure-search-sample-data/blob/master/hotels/Hotels_IndexDefinition.JSON) used in other walkthroughs. We trimmed it in this quickstart for brevity.
116116

@@ -318,7 +318,7 @@ This step shows you how to query an index using the **search** method of the [se
318318
print(" {}".format(facet))
319319
```
320320

321-
1. In this example, look up a specific document based on its key. You would typically want to return a document when a user clicks on a document in a search result.
321+
1. In this example, look up a specific document based on its key. You would typically want to return a document when a user select on a document in a search result.
322322

323323
```python
324324
result = search_client.get_document(key="3")
@@ -329,7 +329,7 @@ This step shows you how to query an index using the **search** method of the [se
329329
print("Category: {}".format(result["Category"]))
330330
```
331331

332-
1. In this example, we'll use the autocomplete function. This is typically used in a search box to help auto-complete potential matches as the user types into the search box.
332+
1. In this example, we'll use the autocomplete function. Autocomplete is typically used in a search box to provide potential matches as the user types into the search box.
333333

334334
When the index was created, a suggester named "sg" was also created as part of the request. A suggester definition specifies which fields can be used to find potential matches to suggester requests. In this example, those fields are 'Tags', 'Address/City', 'Address/Country'. To simulate auto-complete, pass in the letters "sa" as a partial string. The autocomplete method of [SearchClient](/python/api/azure-search-documents/azure.search.documents.searchclient) sends back potential term matches.
335335

@@ -348,7 +348,7 @@ When you're working in your own subscription, it's a good idea at the end of a p
348348

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

351-
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.
351+
If you're using a free service, remember that you're limited to three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
352352

353353
## Next steps
354354

0 commit comments

Comments
 (0)