You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/search/tutorial-csharp-paging.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -455,7 +455,7 @@ This variable is a string, which holds "next" if the next page of results should
455
455
});
456
456
}
457
457
}
458
-
</script>
458
+
</script>
459
459
```
460
460
461
461
The **if** statement in the script above tests to see if the user has scrolled to the bottom of the vertical scroll bar. If they have, a call to the **Home** controller is made to an action called **Next**. No other information is needed by the controller, it will return the next page of data. This data is then formatted using identical HTML styles as the original page. If no results are returned, nothing is appended and things stay as they are.
// Convert the suggest query results to a list that can be displayed in the client.
@@ -119,9 +119,9 @@ Now we can use the predefined autocomplete jquery functions.
119
119
}
120
120
```
121
121
122
-
The**Top**parameterspecifieshowmanyresultstoreturn (ifunspecified, thedefaultis5). A_suggester_isspecifiedontheAzureindex, whichisdone 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 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 simply searches the **HotelName** field - nothing else.
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.
125
125
126
126
2. You may get some syntax errors. If so, add the following two **using** statements to the top of the file.
127
127
@@ -134,7 +134,7 @@ using System.Linq;
134
134
135
135

136
136
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, not simply be included within the word.
138
138
139
139
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!
140
140
@@ -149,7 +149,7 @@ We can improve the appearance of the suggestions to the user a bit, by setting t
149
149
1. In the view (index.cshtml), add the following script after the **azureautosuggest** script you entered above.
Oneofthequestionsadeveloperneedstoansweris when is a script working "well enough" and when should its quirks be addressed. We will not be taking highlighting any further in this tutorial, but finding a precise algorithm is something to consider if taking highlighting further.
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).
240
+
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).
240
241
241
-
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/en-us/rest/api/searchservice/autocomplete) for a description of the range of options here.
242
243
243
-
4. Run the app. Notice how the range of options are single words. Try typing words starting with "re". Notice how the number of options reduces as more letters are typed.
244
+
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.
244
245
245
246

246
247
247
248
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.
248
249
249
250
## Combine autocompletion and suggestions
250
251
251
-
Combining autocompletion and suggestions is the most complex of our options and probably provides the best user experience. What we want is to display, inline with the text that is being typed, the first choice of Azure Search for autocompleting the text. Also, we want a range of suggestions as a drop-down list.
252
+
Combining autocompletion and suggestions is the most complex of our options, and probably provides the best user experience. What we want is to display, inline with the text that is being typed, the first choice of Azure Search for autocompleting the text. Also, we want a range of suggestions as a drop-down list.
252
253
253
-
There are libraries that offer this functionality - often called "inline autocompletion" or a similar name. However, we are going to natively implement this feature so you can see what is going on. We are going to start work on the controller first in this example.
254
+
There are libraries that offer this functionality - often called "inline autocompletion" or a similar name. However, we are going to natively implement this feature, so you can see what is going on. We are going to start work on the controller first in this example.
254
255
255
256
1. We need to add an action to the controller that returns just one autocompletion result, along with a specified number of suggestions. We will call this action **AutocompleteAndSuggest**. In the home controller, add the following action, following your other new actions.
256
257
@@ -314,7 +315,7 @@ One autocompletion option is returned at the top of the **results** list, follow
0 commit comments