Skip to content

Commit 9d95e8e

Browse files
author
PeterTurcan
committed
acrolinx feedback on type ahead
1 parent ddec39a commit 9d95e8e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ In this tutorial, you learn how to:
2424

2525
To complete this tutorial, you need to:
2626

27-
Have the [C# Tutorial: Search results pagination - Azure Search](tutorial-csharp-paging.md) project up and running. This can either be your own version, that you completed in the previous tutorial, or install it from GitHub: [Create first app](https://github.com/Azure-Samples/azure-search-dotnet-samples).
27+
Have the [C# Tutorial: Search results pagination - Azure Search](tutorial-csharp-paging.md) project up and running. This project can either be your own version, that you completed in the previous tutorial, or install it from GitHub: [Create first app](https://github.com/Azure-Samples/azure-search-dotnet-samples).
2828

2929
## Add suggestions
3030

31-
Let's start with the simplest case of offering up alternatives to the user: simply a drop-down list of suggestions.
31+
Let's start with the simplest case of offering up alternatives to the user: a drop-down list of suggestions.
3232

3333
1. In the index.cshtml file, change the **TextBoxFor** statement to the following.
3434

@@ -73,7 +73,7 @@ The autocomplete function called in the script above is not something we have to
7373
</head>
7474
```
7575

76-
2. We also need to remove, or comment out, a line referencing jquery in the _Layout.cshtml file (in the **Views/Shared** folder). Locate the following lines, and comment out the first script line as shown. This avoids clashing references to jquery.
76+
2. We also need to remove, or comment out, a line referencing jquery in the _Layout.cshtml file (in the **Views/Shared** folder). Locate the following lines, and comment out the first script line as shown. This change avoids clashing references to jquery.
7777

7878
```cs
7979
<environment include="Development">
@@ -119,7 +119,7 @@ Now we can use the predefined autocomplete jquery functions.
119119
}
120120
```
121121

122-
The **Top** parameter specifies how many results to return (if unspecified, the default is 5). A _suggester_ is specified on the Azure index, which is done when the data is set up, and not by a client app such as this tutorial. In this case, the suggester is called "sg" and it simply searches the **HotelName** field - nothing else.
122+
The **Top** parameter specifies how many results to return (if unspecified, the default is 5). A _suggester_ is specified on the Azure index, which is done when the data is set up, and not by a client app such as this tutorial. In this case, the suggester is called "sg", and it searches the **HotelName** field - nothing else.
123123

124124
Fuzzy matching allows "near misses" to be included in the output. If the **highlights** parameter is set to true, then bold HTML tags are added to the output. We will set these two parameters to true in the next section.
125125

@@ -134,7 +134,7 @@ using System.Linq;
134134

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

137-
Notice that the letters you enter _must_ start a word, not simply be included within the word.
137+
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

@@ -275,7 +275,7 @@ There are libraries that offer this functionality - often called "inline autocom
275275
};
276276

277277
// Only one suggester can be specified per index. The name of the suggester is set when the suggester is specified by other API calls.
278-
// The suggester for the hotel database is called "sg" and simply searches the hotel name.
278+
// The suggester for the hotel database is called "sg", and it searches only the hotel name.
279279
DocumentSuggestResult<Hotel> suggestResult = await _indexClient.Documents.SuggestAsync<Hotel>(term, "sg", sp);
280280

281281
// Create an empty list.
@@ -430,7 +430,7 @@ Notice the clever use of the **interval** function to both clear the underlying
430430

431431
Read through the comments in the script to get a fuller understanding.
432432

433-
4. Finally, we need to make a minor adjustments to two HTML class to make them transparent. Add the following line to the **searchBoxForm** and **searchBox** classes, in the hotels.css file.
433+
4. Finally, we need to make a minor adjustment to two HTML class to make them transparent. Add the following line to the **searchBoxForm** and **searchBox** classes, in the hotels.css file.
434434

435435
```cs
436436
background: rgba(0,0,0,0);
@@ -442,7 +442,7 @@ Read through the comments in the script to get a fuller understanding.
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

445-
Of course, you may decide that it is simpler to load in a library that offers this feature for you, but now you know at least one way of how to get it to work!
445+
You may decide that it is simpler to load in a library that offers this feature for you, but now you know at least one way to get inline autocompletion to work!
446446

447447
## Takeaways
448448

@@ -455,7 +455,7 @@ Consider the following takeaways from this project:
455455

456456
## Next steps
457457

458-
One of the issues with autocompletion and suggestions is that they involve repeated calls to the server (one on every key stroke after the minimum number of characters typed is reached). If this results in slower than expected responses, then the user experience diminishes. Using facets provides an interesting alternative to avoid these repeated calls, which we will look at next.
458+
One of the issues with autocompletion and suggestions is that they involve repeated calls to the server (one on every key stroke after the minimum number of characters typed is reached). If these repeated calls results in slower than expected responses, then the user experience diminishes. Using facets provides an interesting alternative to avoid these repeated calls, which we will look at next.
459459

460460
> [!div class="nextstepaction"]
461461
> [C# Tutorial: Use facets for navigation and network efficiency - Azure Search](tutorial-csharp-facets.md)

0 commit comments

Comments
 (0)