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/search-get-started-dotnet.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,14 @@ Before you begin, have the following tools and services:
26
26
27
27
+ An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
28
28
29
-
+ An Azure Cognitive Search service. [Create a service](search-create-service-portal.md) or [find an existing service](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices). You can use a free service for this quickstart.
29
+
+ An Azure Cognitive Search service. [Create a service](search-create-service-portal.md) or [find an existing service](https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/Microsoft.Search%2FsearchServices). You can use a free service for this quickstart.
30
30
31
31
+[Visual Studio](https://visualstudio.microsoft.com/downloads/), any edition. Sample code was tested on the free Community edition of Visual Studio 2019.
32
32
33
33
When setting up your project, you'll download the [Azure.Search.Documents NuGet package](https://www.nuget.org/packages/Azure.Search.Documents/).
34
34
35
35
Azure SDK for .NET conforms to [.NET Standard 2.0](/dotnet/standard/net-standard#net-implementation-support), which means .NET Framework 4.6.1 and .NET Core 2.1 as minimum requirements.
36
+
36
37
## Set up your project
37
38
38
39
Assemble service connection information, and then start Visual Studio to create a new Console App project that can run on. Select NET Core 3.1 for the run time.
@@ -57,7 +58,7 @@ After the project is created, add the client library. The [Azure.Search.Document
57
58
58
59
1. Start Visual Studio and create a .NET Core console application.
59
60
60
-
1. In **Tools** > **NuGet Package Manager**, select **Manage NuGet Packages for Solution...**.
61
+
1. In **Tools** > **NuGet Package Manager**, select **Manage NuGet Packages for Solution...**.
61
62
62
63
1. Select **Browse**.
63
64
@@ -157,7 +158,7 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
157
158
158
159
+ `SearchableField` must be astring, andisalwayssearchableandretrievable. Otherattributesareoffbydefault, butcanbeenabled. Becausethisfieldtypeissearchable, itsupportssynonymsandthefullcomplementofanalyzerproperties. Formoreinformation, seethe [SearchableFieldAttribute.cs](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/search/Azure.Search.Documents/src/Indexes/SearchableFieldAttribute.cs) in source code.
1. Addasecondemptyclassdefinition to your project: **Address.cs**. Copythefollowingcodeintotheclass.
163
164
@@ -212,7 +213,7 @@ In this example, synchronous methods of the Azure.Search.Documents library are u
212
213
213
214
Azure Cognitive 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.
214
215
215
-
In Azure Cognitive 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.
216
+
In Azure Cognitive 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.
216
217
217
218
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 Cognitive Search what action to perform ([upload, merge, delete, and mergeOrUpload](search-what-is-data-import.md#indexing-actions)).
218
219
@@ -404,7 +405,7 @@ The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) c
404
405
WriteDocuments(response);
405
406
```
406
407
407
-
1. Inthesecondquery, searchonaterm, addafilterthatselectsdocumentswhereRatingisgreaterthan 4, andthensortbyRatingindescendingorder. Filterisabooleanexpressionthatisevaluatedover [IsFilterable](/dotnet/api/azure.search.documents.indexes.models.searchfield.isfilterable) fieldsinanindex. Filterquerieseitherincludeorexcludevalues. Assuch, there's no relevance score associated with a filter query.
408
+
1. Inthesecondquery, searchonaterm, addafilterthatselectsdocumentswhereRatingisgreaterthan 4, andthensortbyRatingindescendingorder. Filterisabooleanexpressionthatisevaluatedover [IsFilterable](/dotnet/api/azure.search.documents.indexes.models.searchfield.isfilterable) fieldsinanindex. Filterquerieseitherincludeorexcludevalues. Assuch, there's no relevance score associated with a filter query.
408
409
409
410
```csharp
410
411
// Query 2
@@ -443,7 +444,7 @@ The [SearchResults](/dotnet/api/azure.search.documents.models.searchresults-1) c
Ifyou're using a free service, remember that you'relimitedtothreeindexes, indexers, anddatasources. Youcandeleteindividualitemsintheportaltostayunderthelimit.
518
+
Ifyou're using a free service, remember that you'relimitedtothreeindexes, indexers, anddatasources. Youcandeleteindividualitemsintheportaltostayunderthelimit.
Copy file name to clipboardExpand all lines: articles/search/search-howto-index-sharepoint-online.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,13 @@ ms.date: 04/04/2023
14
14
15
15
# Index data from SharePoint document libraries
16
16
17
-
> [!IMPORTANT]
18
-
> SharePoint indexer support is currently in public preview under [Supplemental Terms of Use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). [Request access](https://aka.ms/azure-cognitive-search/indexer-preview) to this feature, and after access is enabled, use a [preview REST API (2020-06-30-preview or later)](search-api-preview.md) to index your content. There is currently limited portal support and no .NET SDK support.
17
+
> [!IMPORTANT]
18
+
> SharePoint indexer support is in public preview. It's offered "as-is", under [Supplemental Terms of Use](https://azure.microsoft.com/support/legal/preview-supplemental-terms/). Preview features aren't recommended for production workloads and aren't guaranteed to become generally available.
19
+
>
20
+
>To use this preview, [request access](https://aka.ms/azure-cognitive-search/indexer-preview), and after access is enabled, use a [preview REST API (2020-06-30-preview or later)](search-api-preview.md) to index your content. There is currently limited portal support and no .NET SDK support.
19
21
20
22
This article explains how to configure a [search indexer](search-indexer-overview.md) to index documents stored in SharePoint document libraries for full text search in Azure Cognitive Search. Configuration steps are followed by a deeper exploration of behaviors and scenarios you're likely to encounter.
21
23
22
-
23
24
## Functionality
24
25
25
26
An indexer in Azure Cognitive Search is a crawler that extracts searchable data and metadata from a data source. The SharePoint indexer will connect to your SharePoint site and index documents from one or more document libraries. The indexer provides the following functionality:
You can get the [service URL and API key](search-get-started-dotnet.md#copy-a-key-and-endpoint) from the portal. Because this code is querying an index and not creating one, you can use a query key instead of an admin key.
74
+
75
+
Make sure to specify the search service that has the hotels-sample-index.
72
76
73
77
## Add models
74
78
75
-
In this step, create models that represent the schema of the hotels-search-index.
79
+
In this step, create models that represent the schema of the hotels-sample-index.
76
80
77
81
1. In Solution explorer, right-select **Models** and add a new class named "Hotel" for the following code:
0 commit comments