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/includes/quickstarts/dotnet.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Alternatively, you can [download the source code](https://github.com/Azure-Sampl
26
26
27
27
#### Create a search client
28
28
29
-
1. In **Program.cs**, change the namespace to `AzureSearch.SDK.Quickstart.v11` and then add the following `using` directives.
29
+
1. In *Program.cs*, change the namespace to `AzureSearch.SDK.Quickstart.v11` and then add the following `using` directives.
30
30
31
31
```csharp
32
32
usingAzure;
@@ -62,11 +62,11 @@ Alternatively, you can [download the source code](https://github.com/Azure-Sampl
62
62
63
63
ThisquickstartbuildsaHotelsindexthatyou'll load with hotel data and execute queries against. In this step, define the fields in the index. Each field definition includes a name, data type, and attributes that determine how the field is used.
64
64
65
-
Inthisexample, synchronousmethodsoftheAzure.Search.Documentslibraryareusedfor simplicity and readability. However, for production scenarios, you should use asynchronous methods to keep your app scalable and responsive. For example, you would use [CreateIndexAsync](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindexasync) insteadof [CreateIndex](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindex).
65
+
Inthisexample, synchronousmethodsofthe*Azure.Search.Documents*libraryareusedfor simplicity and readability. However, for production scenarios, you should use asynchronous methods to keep your app scalable and responsive. For example, you would use [CreateIndexAsync](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindexasync) insteadof [CreateIndex](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindex).
66
66
67
-
1. Addanemptyclassdefinition to your project: **Hotel.cs**
67
+
1. Addanemptyclassdefinition to your project: *Hotel.cs*
68
68
69
-
1. Copythefollowingcodeinto **Hotel.cs** todefinethestructureofahoteldocument. Attributesonthefielddeterminehowit'susedinanapplication. Forexample, the `IsFilterable` attributemustbeassignedtoeveryfieldthatsupportsafilterexpression.
69
+
1. Copythefollowingcodeinto *Hotel.cs* todefinethestructureofahoteldocument. Attributesonthefielddeterminehowit'susedinanapplication. Forexample, the `IsFilterable` attributemustbeassignedtoeveryfieldthatsupportsafilterexpression.
70
70
71
71
```csharp
72
72
usingSystem;
@@ -112,15 +112,15 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
112
112
}
113
113
```
114
114
115
-
IntheAzure.Search.Documentsclientlibrary, youcanuse [SearchableField](/dotnet/api/azure.search.documents.indexes.models.searchablefield) and [SimpleField](/dotnet/api/azure.search.documents.indexes.models.simplefield) tostreamlinefielddefinitions. Botharederivativesofa [SearchField](/dotnet/api/azure.search.documents.indexes.models.searchfield) andcanpotentiallysimplifyyourcode:
115
+
Inthe*Azure.Search.Documents*clientlibrary, youcanuse [SearchableField](/dotnet/api/azure.search.documents.indexes.models.searchablefield) and [SimpleField](/dotnet/api/azure.search.documents.indexes.models.simplefield) tostreamlinefielddefinitions. Botharederivativesofa [SearchField](/dotnet/api/azure.search.documents.indexes.models.searchfield) andcanpotentiallysimplifyyourcode:
116
116
117
117
+ `SimpleField` canbeanydatatype, isalwaysnon-searchable (it'signoredforfulltextsearchqueries), andisretrievable (it'snothidden). Otherattributesareoffbydefault, butcanbeenabled. Youmightusea `SimpleField` for document IDs or fields used only in filters, facets, or scoring profiles. If so, be sure to apply any attributes that are necessary for the scenario, such as `IsKey = true` for a document ID. For more information, see [SimpleFieldAttribute.cs](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/src/Indexes/SimpleFieldAttribute.cs) in source code.
118
118
119
119
+ `SearchableField` must be astring, andisalwayssearchableandretrievable. Otherattributesareoffbydefault, butcanbeenabled. Becausethisfieldtypeissearchable, itsupportssynonymsandthefullcomplementofanalyzerproperties. Formoreinformation, seethe [SearchableFieldAttribute.cs](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/src/Indexes/SearchableFieldAttribute.cs) in source code.
1. Addasecondemptyclassdefinition to your project: **Address.cs**. Copythefollowingcodeintotheclass.
123
+
1. Addasecondemptyclassdefinition to your project: *Address.cs*. Copythefollowingcodeintotheclass.
124
124
125
125
```csharp
126
126
usingAzure.Search.Documents.Indexes;
@@ -147,9 +147,9 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
147
147
}
148
148
```
149
149
150
-
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/main/quickstart/v11/AzureSearchQuickstart-v11).
150
+
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/main/quickstart/v11/AzureSearchQuickstart-v11).
151
151
152
-
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.
152
+
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.
153
153
154
154
```csharp
155
155
// Create hotels-quickstart index
@@ -175,7 +175,7 @@ In Azure AI Search, search documents are data structures that are both inputs to
175
175
176
176
When uploading documents, you must use an [IndexDocumentsBatch](/dotnet/api/azure.search.documents.models.indexdocumentsbatch-1) object. An `IndexDocumentsBatch` object contains a collection of [Actions](/dotnet/api/azure.search.documents.models.indexdocumentsbatch-1.actions), each of which contains a document and a property telling Azure AI Search what action to perform ([upload, merge, delete, and mergeOrUpload](/azure/search/search-what-is-data-import#indexing-actions)).
177
177
178
-
1. In **Program.cs**, create an array of documents and index actions, and then pass the array to `IndexDocumentsBatch`. The following documents conform to the hotels-quickstart index, as defined by the hotel class.
178
+
1. In *Program.cs*, create an array of documents and index actions, and then pass the array to `IndexDocumentsBatch`. The following documents conform to the hotels-quickstart index, as defined by the hotel class.
179
179
180
180
```csharp
181
181
// Upload documents in a single Upload request.
@@ -311,7 +311,7 @@ This section adds two pieces of functionality: query logic, and results. For que
311
311
312
312
The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) classrepresents the results.
313
313
314
-
1. In **Program.cs**, create a `WriteDocuments` method that prints search results to the console.
314
+
1. In *Program.cs*, create a `WriteDocuments` method that prints search results to the console.
Copy file name to clipboardExpand all lines: articles/search/search-get-started-text.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
@@ -19,7 +19,7 @@ ms.date: 10/07/2024
19
19
20
20
# Quickstart: Full text search using the Azure SDKs
21
21
22
-
Learn how to use the **Azure.Search.Documents** client library in an Azure SDK to create, load, and query a search index using sample data for [full text search](search-lucene-query-architecture.md). Full text search uses Apache Lucene for indexing and queries, and a BM25 ranking algorithm for scoring results.
22
+
Learn how to use the *Azure.Search.Documents* client library in an Azure SDK to create, load, and query a search index using sample data for [full text search](search-lucene-query-architecture.md). Full text search uses Apache Lucene for indexing and queries, and a BM25 ranking algorithm for scoring results.
0 commit comments