Skip to content

Commit ea591a9

Browse files
Merge pull request #6099 from diberry/diberry/0717-uat-assist-ai-search-tutorial-1
AI Search - UAT assist - .Net MVC
2 parents e4c77ee + 688d532 commit ea591a9

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ ms.date: 07/10/2025
1717

1818
# Create a search app in ASP.NET Core
1919

20-
In this tutorial, create a basic ASP.NET Core (Model-View-Controller) app that runs in localhost and connects to the hotels-sample-index on your search service. In this tutorial, learn how to:
20+
In this tutorial, you create a basic ASP.NET Core (Model-View-Controller) app that runs in localhost and connects to the hotels-sample-index on your search service. You learn how to:
2121

2222
> [!div class="checklist"]
2323
> + Create a basic search page
2424
> + Filter results
2525
> + Sort results
2626
27-
This tutorial puts the focus on server-side operations called through the [Search APIs](/dotnet/api/overview/azure/search.documents-readme). Although it's common to sort and filter in client-side script, knowing how to invoke these operations on the server gives you more options when designing the search experience.
27+
This tutorial focuses on server-side operations called through the [Search APIs](/dotnet/api/overview/azure/search.documents-readme). Although it's common to sort and filter in client-side script, knowing how to invoke these operations on the server gives you more options when designing the search experience.
2828

29-
Sample code for this tutorial can be found in the [azure-search-dotnet-samples](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/main/create-mvc-app) repository on GitHub.
29+
You can find sample code for this tutorial in the [azure-search-dotnet-samples](https://github.com/Azure-Samples/azure-search-dotnet-samples/tree/main/create-mvc-app) repository on GitHub.
3030

3131
## Prerequisites
3232

@@ -43,21 +43,21 @@ Sample code for this tutorial can be found in the [azure-search-dotnet-samples](
4343

4444
1. Select **ASP.NET Core Web App (Model-View-Controller)**, and then select **Next**.
4545

46-
1. Provide a project name, and then select **Next**.
46+
1. Enter a project name, and then select **Next**.
4747

4848
1. On the next page, select **.NET 9.0**.
4949

50-
1. Accept the defaults.
50+
1. Accept the default settings.
5151

5252
1. Select **Create**.
5353

5454
### Add NuGet packages
5555

56-
1. On Tools, select **NuGet Package Manager** > **Manage NuGet Packages for the solution**.
56+
1. On the **Tools** menu, select **NuGet Package Manager** > **Manage NuGet Packages for the solution**.
5757

5858
1. Browse for `Azure.Search.Documents` and install the latest stable version.
5959

60-
1. Browse for and install the `Microsoft.Spatial` package. The sample index includes a GeographyPoint data type. Installing this package avoids run time errors. Alternatively, remove the "Location" field from the Hotels class if you don't want to install the package. That field isn't used in this tutorial.
60+
1. Browse for and install the `Microsoft.Spatial` package. The sample index includes a `GeographyPoint` data type. Installing this package avoids run time errors. Alternatively, remove the "Location" field from the `Hotels` class if you don't want to install the package. That field isn't used in this tutorial.
6161

6262
### Add service information
6363

@@ -74,13 +74,13 @@ Modify `appsettings.json` to specify your search service and [query API key](sea
7474

7575
You can get the service URL and API key from the Azure portal. Because this code is querying an index and not creating one, you can use a query key instead of an admin key.
7676

77-
Make sure to specify a search service that has the hotels-sample-index.
77+
Make sure to specify a search service that has the `hotels-sample-index`.
7878

7979
## Add models
8080

81-
In this step, create models that represent the schema of the hotels-sample-index.
81+
In this step, you create models that represent the schema of the hotels-sample-index.
8282

83-
1. In Solution explorer, right-select **Models** and add a new class named "Hotel" for the following code:
83+
1. In Solution Explorer, right-select **Models** and add a new class named "Hotel" for the following code:
8484

8585
```csharp
8686
using Azure.Search.Documents.Indexes.Models;
@@ -218,9 +218,9 @@ In this step, create models that represent the schema of the hotels-sample-index
218218

219219
For this tutorial, modify the default `HomeController` to contain methods that execute on your search service.
220220

221-
1. In Solution explorer under **Models**, open `HomeController`.
221+
1. In Solution Explorer under **Models**, open `HomeController`.
222222

223-
1. Replace the default with the following content:
223+
1. Replace the default content with the following code:
224224

225225
```csharp
226226
using Azure;
@@ -322,9 +322,9 @@ For this tutorial, modify the default `HomeController` to contain methods that e
322322

323323
## Modify the view
324324

325-
1. In Solution explorer under **Views** > **Home**, open `index.cshtml`.
325+
1. In Solution explorer, under **Views** > **Home**, open `index.cshtml`.
326326

327-
1. Replace the default with the following content:
327+
1. Replace the default content with the following code:
328328

329329
```razor
330330
@model HotelDemoApp.Models.SearchData;
@@ -393,7 +393,7 @@ For this tutorial, modify the default `HomeController` to contain methods that e
393393
394394
## Run the sample
395395
396-
1. Press **F5** to compile and run the project. The app runs on local host and opens in your default browser.
396+
1. Press **F5** to compile and run the project. The app runs on localhost and opens in your default browser.
397397
398398
1. Select **Search** to return all results.
399399
@@ -405,7 +405,7 @@ In the next several sections, modify the **RunQueryAsync** method in the `HomeCo
405405
406406
Index field attributes determine which fields are searchable, filterable, sortable, facetable, and retrievable. In the hotels-sample-index, filterable fields include Category, Address/City, and Address/StateProvince. This example adds a [$Filter](search-query-odata-filter.md) expression on Category.
407407
408-
A filter always executes first, followed by a query assuming one is specified.
408+
A filter always executes first, followed by a query, assuming you specify one.
409409
410410
1. Open the `HomeController` and find the **RunQueryAsync** method. Add [Filter](/dotnet/api/azure.search.documents.searchoptions.filter) to `var options = new SearchOptions()`:
411411
@@ -444,7 +444,7 @@ For more information about filter expressions, see [Filters in Azure AI Search](
444444

445445
In the hotels-sample-index, sortable fields include Rating and LastRenovated. This example adds an [$OrderBy](/dotnet/api/azure.search.documents.searchoptions.orderby) expression to the Rating field.
446446

447-
1. Open the `HomeController` and replace **RunQueryAsync** method with the following version:
447+
1. Open the `HomeController` and replace the **RunQueryAsync** method with the following version:
448448

449449
```csharp
450450
private async Task<ActionResult> RunQueryAsync(SearchData model)
@@ -478,6 +478,6 @@ For more information about sorting, see [OData $orderby syntax in Azure AI Searc
478478

479479
## Next step
480480

481-
In this tutorial, you created an ASP.NET Core (MVC) project that connected to a search service and called Search APIs for server-side filtering and sorting.
481+
In this tutorial, you created an ASP.NET Core (MVC) project that connects to a search service and calls Search APIs for server-side filtering and sorting.
482482

483-
To add client-side code that responds to user actions, use a React template in your solution: [C# Tutorial: Add search to a website with .NET](tutorial-csharp-overview.md)
483+
To add client-side code that responds to user actions, use a React template in your solution: [C# Tutorial: Add search to a website with .NET](tutorial-csharp-overview.md).

0 commit comments

Comments
 (0)