Skip to content

Commit 27e7027

Browse files
author
PeterTurcan
committed
v-alberni feedback 1
1 parent f6a9549 commit 27e7027

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed
320 Bytes
Loading

articles/search/tutorial-csharp-create-first-app.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ To complete this tutorial, you need to:
5151
1. Using Visual Studio, navigate to, and open the solution for the basic search page, and select **Start without debugging** (or press F5).
5252
1. Type in some words (for example "wifi", "view", "bar", "parking"), and examine the results!
5353

54-
![Searching for "wifi"](./media/tutorial-csharp-create-first-app/azure-search-wifi.png)
54+
![Searching for "wifi"](./media/tutorial-csharp-create-first-app/azure-search-wifi.png)
5555

5656
Hopefully this project will run smoothly, and you have Azure app running. Many of the essential components for more sophisticated searches are included in this one app, so it is a good idea to go through it, and recreate it step by step.
5757

@@ -60,15 +60,15 @@ To create this project from scratch, and hence help reinforce the components of
6060
## Set up a development environment
6161

6262
1. In Visual Studio 2017, or later, select **New/Project** then **ASP.NET Core Web Application**. Give the project a name such as "FirstAzureSearchApp".
63-
![Creating a cloud project](./media/tutorial-csharp-create-first-app/azure-search-project1.png)
63+
![Creating a cloud project](./media/tutorial-csharp-create-first-app/azure-search-project1.png)
6464

6565
2. After you have clicked **OK** for this project type, you will be given a second set of options that apply to this project. Select **Web Application (Model-View-Controller)**.
6666

67-
![Creating an MVC project](./media/tutorial-csharp-create-first-app/azure-search-project2.png)
67+
![Creating an MVC project](./media/tutorial-csharp-create-first-app/azure-search-project2.png)
6868

6969
3. Next, in the **Tools** menu, select **NuGet Package Manager** and then **Manage NuGet Packages for Solution...**. There is one package we need to install. Select the **Browse** tab then type "Azure Search" into the search box. Install **Microsoft.Azure.Search** when it appears in the list (version 9.0.1, or later). You will have to click through a few additional dialogs to complete the installation.
7070

71-
![Using NuGet to add Azure libraries](./media/tutorial-csharp-create-first-app/azure-search-nuget-azure.png)
71+
![Using NuGet to add Azure libraries](./media/tutorial-csharp-create-first-app/azure-search-nuget-azure.png)
7272

7373
### Initialize Azure Search
7474

@@ -85,7 +85,7 @@ For this sample, we are using publicly available hotel data. This data is an arb
8585

8686
2. We are not done with this file yet, select the properties for this file, and change the **Copy to Output Directory** setting to **Copy if newer**.
8787

88-
![Copying the app settings to the output](./media/tutorial-csharp-create-first-app/azure-search-copy-if-newer.png)
88+
![Copying the app settings to the output](./media/tutorial-csharp-create-first-app/azure-search-copy-if-newer.png)
8989

9090
## Model data structures
9191

@@ -505,11 +505,11 @@ Now, let's check the app runs correctly.
505505

506506
1. Select **Debug/Start Without Debugging** or press the F5 key. If you have coded things correctly, you will get the initial Index view.
507507

508-
![Opening the app](./media/tutorial-csharp-create-first-app/azure-search-index.png)
508+
![Opening the app](./media/tutorial-csharp-create-first-app/azure-search-index.png)
509509

510510
2. Enter text such as "beach" (or any text that comes to mind), and click the search icon. You should get some results.
511511

512-
![Searching for "beach"](./media/tutorial-csharp-create-first-app/azure-search-beach.png)
512+
![Searching for "beach"](./media/tutorial-csharp-create-first-app/azure-search-beach.png)
513513

514514
3. Try entering "five star". Note how you get no results. A more sophisticated search would treat "five star" as a synonym for "luxury" and return those results. The use of synonyms is available in Azure Search, though we will not be covering it in the first tutorials.
515515

@@ -525,7 +525,7 @@ It is important to verify that our error handling features work as they should,
525525

526526
2. Run the app, enter "bar" as search text, and click the search icon. The exception should result in the error view.
527527

528-
![Force an error](./media/tutorial-csharp-create-first-app/azure-search-error.png)
528+
![Force an error](./media/tutorial-csharp-create-first-app/azure-search-error.png)
529529

530530
> [!Important]
531531
> It is considered a security risk to return internal error numbers in error pages. If your app is intended for general use, do some investigation into secure and best practices of what to return when an error occurs.

articles/search/tutorial-csharp-paging.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,19 +364,19 @@ Now select **Start Without Debugging** (or press the F5 key).
364364

365365
1. Search on some text that will give plenty of results (such as "wifi"). Can you page neatly through the results?
366366

367-
![Numbered paging through "pool" results](./media/tutorial-csharp-create-first-app/azure-search-numbered-paging.png)
367+
![Numbered paging through "pool" results](./media/tutorial-csharp-create-first-app/azure-search-numbered-paging.png)
368368

369369
2. Try clicking on the right-most, and later, left-most page numbers. Do the page numbers adjust appropriately to center the page you are on?
370370

371371
3. Are the "first" and "last" options useful? Some popular web searches use these options, and others do not.
372372

373373
4. Go to the last page of results. The last page is the only page that may contain less than **ResultsPerPage** results.
374374

375-
![Examining last page of "wifi"](./media/tutorial-csharp-create-first-app/azure-search-pool-last-page.png)
375+
![Examining last page of "wifi"](./media/tutorial-csharp-create-first-app/azure-search-pool-last-page.png)
376376

377377
5. Type in "town", and click search. No paging options are displayed if there are less than one page worth of results.
378378

379-
![Searching for "town"](./media/tutorial-csharp-create-first-app/azure-search-town.png)
379+
![Searching for "town"](./media/tutorial-csharp-create-first-app/azure-search-town.png)
380380

381381
Now save off this project and let's try an alternative to this form of paging.
382382

@@ -569,7 +569,7 @@ Now select **Start Without Debugging** (or press the F5 key).
569569

570570
1. Enter a term that will give plenty of results (such as "pool") and then test the vertical scroll bar. Does it trigger a new page of results?
571571

572-
![Infinite scrolling through "pool" results](./media/tutorial-csharp-create-first-app/azure-search-infinite-scroll.png)
572+
![Infinite scrolling through "pool" results](./media/tutorial-csharp-create-first-app/azure-search-infinite-scroll.png)
573573

574574
> [!Tip]
575575
> To ensure that a scroll bar appears on the first page, the first page of results must slightly exceed the height of the area they are being displayed in. In our example **.box1** has a height of 30 pixels, **.box2** has a height of 100 pixels _and_ a bottom margin of 24 pixels. So each entry uses 154 pixels. Three entries will take up 3 x 154 = 462 pixels. To ensure that a vertical scroll bar appears, a height to the display area must be set that is smaller than 462 pixels, even 461 works. This issue only occurs on the first page, after that a scroll bar is sure to appear. The line to update is: **<div id="myDiv" style="width: 800px; height: 450px; overflow-y: scroll;" onscroll="scrolled()">**.

articles/search/tutorial-csharp-type-ahead-and-suggestions.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Let's start with the simplest case of offering up alternatives to the user: a dr
3636
@Html.TextBoxFor(m => m.searchText, new { @class = "searchBox", @id = "azureautosuggest" }) <input value="" class="searchBoxSubmit" type="submit">
3737
```
3838

39-
The key here is that we have set the **id** of the search box to **azureautosuggest**.
39+
The key here is that we have set the ID of the search box to **azureautosuggest**.
4040

4141
2. Following this statement, after the closing **&lt;/div&gt;**, enter this script.
4242

@@ -53,7 +53,7 @@ The key here is that we have set the **id** of the search box to **azureautosugg
5353
</script>
5454
```
5555

56-
We have connected this script to the search box via the same id. Also, a minimum of two characters is needed to trigger the search, and we call the **Suggest** action in the home controller with two query parameters: **highlights** and **fuzzy**, both set to false in this instance.
56+
We have connected this script to the search box via the same ID. Also, a minimum of two characters is needed to trigger the search, and we call the **Suggest** action in the home controller with two query parameters: **highlights** and **fuzzy**, both set to false in this instance.
5757

5858
### Add references to jquery scripts to the view
5959

@@ -132,15 +132,15 @@ using System.Linq;
132132

133133
3. Run the app. Do you get a range of options when you enter "po", for example? Now try "pa".
134134

135-
![Typing "po" reveals two suggestions](./media/tutorial-csharp-create-first-app/azure-search-suggest-po.png)
135+
![Typing "po" reveals two suggestions](./media/tutorial-csharp-create-first-app/azure-search-suggest-po.png)
136136

137137
Notice that the letters you enter _must_ start a word, and not simply be included within the word.
138138

139139
4. In the view script, set **&fuzzy** to true, and run the app again. Now enter "po". Notice that the search assumes you got one letter wrong!
140140

141-
![Typing "pa" with fuzzy set to true](./media/tutorial-csharp-create-first-app/azure-search-suggest-fuzzy.png)
141+
![Typing "pa" with fuzzy set to true](./media/tutorial-csharp-create-first-app/azure-search-suggest-fuzzy.png)
142142

143-
If you are interested, the [Lucene query syntax in Azure Search](https://docs.microsoft.com/en-us/azure/search/query-lucene-syntax) describes the logic used in fuzzy searches in detail.
143+
If you are interested, the [Lucene query syntax in Azure Search](https://docs.microsoft.com/azure/search/query-lucene-syntax) describes the logic used in fuzzy searches in detail.
144144

145145
## Add highlighting to the suggestions
146146

@@ -175,15 +175,15 @@ We can improve the appearance of the suggestions to the user a bit, by setting t
175175
</script>
176176
```
177177

178-
2. Now change the id of the text box so it reads as follows.
178+
2. Now change the ID of the text box so it reads as follows.
179179

180180
```cs
181181
@Html.TextBoxFor(m => m.searchText, new { @class = "searchBox", @id = "azuresuggesthighlights" }) <input value="" class="searchBoxSubmit" type="submit">
182182
```
183183

184184
3. Run the app again, and you should see your entered text bolded in the suggestions. Say, try typing "pa".
185185

186-
![Typing "pa" with highlighting](./media/tutorial-csharp-create-first-app/azure-search-suggest-highlight.png)
186+
![Typing "pa" with highlighting](./media/tutorial-csharp-create-first-app/azure-search-suggest-highlight.png)
187187

188188
4. The logic used in the highlighting script above is not foolproof. If you enter a term that appears twice in the same name, the bolded results are not quite what you would want. Try typing "mo".
189189

@@ -208,7 +208,7 @@ Another variation, that is slightly different from suggestions, is autocompletio
208208
</script>
209209
```
210210

211-
2. Now change the **id** of the text box, so it reads as follows.
211+
2. Now change the ID of the text box, so it reads as follows.
212212

213213
```cs
214214
@Html.TextBoxFor(m => m.searchText, new { @class = "searchBox", @id = "azureautocompletebasic" }) <input value="" class="searchBoxSubmit" type="submit">
@@ -239,11 +239,11 @@ Another variation, that is slightly different from suggestions, is autocompletio
239239

240240
Notice that we are using the same *suggester* function, called "sg", in the autocomplete search as we did for suggestions (so we are only trying to autocomplete the hotel names).
241241

242-
There are a range of **AutocompleteMode** settings, and we are using **OneTermWithContext**. Refer to [Azure Autocomplete](https://docs.microsoft.com/en-us/rest/api/searchservice/autocomplete) for a description of the range of options here.
242+
There are a range of **AutocompleteMode** settings, and we are using **OneTermWithContext**. Refer to [Azure Autocomplete](https://docs.microsoft.com/rest/api/searchservice/autocomplete) for a description of the range of options here.
243243

244244
4. Run the app. Notice how the range of options displayed in the drop-down list are single words. Try typing words starting with "re". Notice how the number of options reduces as more letters are typed.
245245

246-
![Typing with basic autocompletion](./media/tutorial-csharp-create-first-app/azure-search-suggest-autocompletebasic.png)
246+
![Typing with basic autocompletion](./media/tutorial-csharp-create-first-app/azure-search-suggest-autocompletebasic.png)
247247

248248
As it stands, the suggestions script you ran earlier is probably more helpful than this autocompletion script. To make autocompletion more user-friendly, it is best added to the suggestion search.
249249

@@ -315,7 +315,7 @@ One autocompletion option is returned at the top of the **results** list, follow
315315
</div>
316316
```
317317

318-
Note we are changing the **id** again, to **azureautocomplete** in this case.
318+
Note we are changing the ID again, to **azureautocomplete** in this case.
319319

320320
3. Also in the view, enter the following script, after all the scripts you have entered so far. There is quite a lot to it.
321321

@@ -438,7 +438,7 @@ Read through the comments in the script to get a fuller understanding.
438438

439439
5. Now run the app. Enter "pa" into the search box. Do you get "palace" as the autocomplete suggestion, along with two hotels that contain "pa"?
440440

441-
![Typing with inline autocomplete and suggestions](./media/tutorial-csharp-create-first-app/azure-search-suggest-autocomplete.png)
441+
![Typing with inline autocomplete and suggestions](./media/tutorial-csharp-create-first-app/azure-search-suggest-autocomplete.png)
442442

443443
6. Try tabbing to accept the autocomplete suggestion, and try selecting suggestions using the arrow keys and tab key, and try again using the mouse and a single click. Verify that the script handles all these situations neatly.
444444

@@ -457,4 +457,4 @@ Consider the following takeaways from this project:
457457

458458
You have completed this series of C# tutorials - you should have gained valuable knowledge of the Azure Search APIs.
459459

460-
For further reference and tutorials, consider browsing [Microsoft Learn](https://docs.microsoft.com/en-us/learn/browse/?products=azure), or the other tutorials in the [Azure Search Documentation](https://docs.microsoft.com/en-us/azure/search/).
460+
For further reference and tutorials, consider browsing [Microsoft Learn](https://docs.microsoft.com/learn/browse/?products=azure), or the other tutorials in the [Azure Search Documentation](https://docs.microsoft.com/azure/search/).

0 commit comments

Comments
 (0)