Skip to content

Commit 559f2f9

Browse files
committed
csharp quickstart run and then explain
1 parent cceca8d commit 559f2f9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

articles/search/includes/quickstarts/full-text-csharp.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ For the recommended keyless authentication with Microsoft Entra ID, you need to:
5858

5959
In the prior [set up](#set-up) section, you created a new console application and installed the Azure AI Search client library.
6060

61-
In this section, you add code to create a search index, load it with documents, and run queries. You run the program to see the results in the console. For an explanation of the code, see the [explaining the code](#explaining-the-code) section.
61+
In this section, you add code to create a search index, load it with documents, and run queries. You run the program to see the results in the console. For a detailed explanation of the code, see the [explaining the code](#explaining-the-code) section.
6262

6363
1. In *Program.cs*, paste the following code. Edit the `serviceName` and `apiKey` variables with your search service name and admin API key.
6464

@@ -620,17 +620,17 @@ static void Main(string[] args)
620620
621621
### Create an index
622622
623-
This quickstart builds a Hotels index that you'll load with hotel data and execute queries against. In this step, you define the fields in the index. Each field definition includes a name, data type, and attributes that determine how the field is used.
623+
This quickstart builds a Hotels index that you load with hotel data and execute queries against. In this step, you define the fields in the index. Each field definition includes a name, data type, and attributes that determine how the field is used.
624624
625625
In this example, synchronous methods of the *Azure.Search.Documents* library are used for 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) instead of [CreateIndex](/dotnet/api/azure.search.documents.indexes.searchindexclient.createindex).
626626
627627
#### Define the structures
628628
629-
You created two helper classes, *Hotel.cs* and *Address.cs*, to define the structure of a hotel document and its address. The `Hotel` class includes fields for a hotel ID, name, description, category, tags, parking, renovation date, rating, and address. The `Address` class includes fields for street address, city, state/province, postal code, and country.
629+
You created two helper classes, *Hotel.cs* and *Address.cs*, to define the structure of a hotel document and its address. The `Hotel` class includes fields for a hotel ID, name, description, category, tags, parking, renovation date, rating, and address. The `Address` class includes fields for street address, city, state/province, postal code, and country/region.
630630
631631
In the *Azure.Search.Documents* client library, you can use [SearchableField](/dotnet/api/azure.search.documents.indexes.models.searchablefield) and [SimpleField](/dotnet/api/azure.search.documents.indexes.models.simplefield) to streamline field definitions. Both are derivatives of a [SearchField](/dotnet/api/azure.search.documents.indexes.models.searchfield) and can potentially simplify your code:
632632
633-
+ `SimpleField` can be any data type, is always non-searchable (it's ignored for full text search queries), and is retrievable (it's not hidden). Other attributes are off by default, but can be enabled. You might use a `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.
633+
+ `SimpleField` can be any data type, is always non-searchable (ignored for full text search queries), and is retrievable (not hidden). Other attributes are off by default, but can be enabled. You might use a `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.
634634
635635
+ `SearchableField` must be a string, and is always searchable and retrievable. Other attributes are off by default, but can be enabled. Because this field type is searchable, it supports synonyms and the full complement of analyzer properties. For more information, see the [SearchableFieldAttribute.cs](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/search/Azure.Search.Documents/src/Indexes/SearchableFieldAttribute.cs) in source code.
636636
@@ -658,7 +658,7 @@ private static void CreateIndex(string indexName, SearchIndexClient adminClient)
658658
659659
### Load documents
660660
661-
Azure AI Search searches over content stored in the service. In this step, you'll load JSON documents that conform to the hotel index you just created.
661+
Azure AI Search searches over content stored in the service. In this step, you load JSON documents that conform to the hotel index you created.
662662
663663
In Azure AI Search, search documents are data structures that are both inputs to indexing and outputs from queries. As obtained from an external data source, document inputs might be rows in a database, blobs in Blob storage, or JSON documents on disk. In this example, we're taking a shortcut and embedding JSON documents for four hotels in the code itself.
664664
@@ -708,7 +708,7 @@ Console.WriteLine("{0}", "Uploading documents...\n");
708708
UploadDocuments(ingesterClient);
709709
```
710710
711-
Because this is a console app that runs all commands sequentially, we add a 2-second wait time between indexing and queries.
711+
Because we have a console app that runs all commands sequentially, we add a 2-second wait time between indexing and queries.
712712
713713
```csharp
714714
// Wait 2 seconds for indexing to complete before starting queries (for demo and console-app purposes only)

articles/search/includes/quickstarts/full-text-intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.topic: include
77
ms.date: 2/8/2025
88
---
99

10-
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.
10+
Learn how to use the *Azure.Search.Documents* client library 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.
1111

12-
This quickstart creates and queries a small hotels-quickstart index containing data about 4 hotels.
12+
This quickstart creates and queries a small hotels-quickstart index containing data about four hotels.
1313

0 commit comments

Comments
 (0)