azure-search-.net-sdk

Index a dictionary property in azure search

南楼画角 提交于 2021-02-17 05:46:48
问题 I have a DTO with a property of type Dictionary<string, string> . It's not annotated. When I upload my DTO and call indexClient.Documents.Index(batch) , I get this error back from the service: The request is invalid. Details: parameters : A node of type 'StartObject' was read from the JSON reader when trying to read the contents of the property 'Data'; however, a 'StartArray' node was expected. The only way I've found to avoid it is by setting it to null. This is how I created my index: var

Using a skillset when adding documents to Azure Search Index

别来无恙 提交于 2021-02-05 11:17:08
问题 I was able to successfully use a skillset (keyword extraction) for a column using an Indexer importing data from a Cosmos DB collection. However I want to eventually use the .NET SDK's DocumentsOperationsExtensions's IndexAsync() method to add documents to the index ( as I already have a change feed listener on the Cosmos DB collection and want to leverage that instead of running a periodic indexer querying Cosmos DB). But I don't see how I can specify the skillset to be used when adding the

Azure Search .net SDK- How to use “FindFailedActionsToRetry”?

你说的曾经没有我的故事 提交于 2020-05-13 05:03:48
问题 Using the Azure Search .net SDK, when you try to index documents you might get an exception IndexBatchException . From the documentation here: try { var batch = IndexBatch.Upload(documents); indexClient.Documents.Index(batch); } catch (IndexBatchException e) { // Sometimes when your Search service is under load, indexing will fail for some of the documents in // the batch. Depending on your application, you can take compensating actions like delaying and // retrying. For this simple demo, we

Why would AzureSearch SDK spontaneously fail with transport connection issue?

▼魔方 西西 提交于 2020-03-18 07:00:07
问题 We had some big excitement yesterday. Two of our web apps (both deployed and untouched for at least 3 months) that use AzureSearch's SDK stopped working at different times (one early morning; the other in the evening). The indexClient.Documents.Search method started failing with this error: HTTPS handshake to XXXXsearch.search.windows.net (for #435) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. <

Azure Search searching by not full word with special characters is not working

跟風遠走 提交于 2020-02-25 03:23:06
问题 I want to search string which contains special characters using Azure Search .NET SDK. I've tried escaping every special character, tried using full query syntax and tried wildcards, nothing worked as expected. Here is the method: public virtual async Task<SearchResultDto<T>> Search(string query, SearchOptionsInput searchOptionsInput) { if (!_azureOptions.IsEnabled) { return null; } var searchIndexClient = GetSearchIndexClientForGivenType(); var searchParameters = _objectMapper.Map

Azure Search searching by not full word with special characters is not working

那年仲夏 提交于 2020-02-25 03:23:05
问题 I want to search string which contains special characters using Azure Search .NET SDK. I've tried escaping every special character, tried using full query syntax and tried wildcards, nothing worked as expected. Here is the method: public virtual async Task<SearchResultDto<T>> Search(string query, SearchOptionsInput searchOptionsInput) { if (!_azureOptions.IsEnabled) { return null; } var searchIndexClient = GetSearchIndexClientForGivenType(); var searchParameters = _objectMapper.Map

Azure Cognitive Search - How to filter by fields containing special characters

北城余情 提交于 2020-02-08 02:32:06
问题 We are using the Azure Cognitive Search .NET SDK and are trying to $filter by a string field that can contain Search-special characters such as & , as well as single quotes. We get zero results when filtering against a test case with the kitchen sink of special characters (we excluded | since it's our separator for search.in ): { "FirmName": "Crazy Charz Inc. ' + - && ! ( ) { } [ ] ^ \" ~ * ? : \\ /" ... } When we escape the special characters with \ as asked about here and recommended here,

How to decode metadata_storage_path produced by Azure Search indexer in .NET Core

余生颓废 提交于 2020-01-10 04:13:09
问题 Using .NetCore 1.1.2. After successfully getting results from a search via Azure Search SDK, I am trying to decode the metadata_storage_path value. I've seen people saying to use HttpServerUtility.UrlTokenDecode in .NET or an equivalent in other languages as seen here. Then the question becomes, what is the equivalent in .NetCore of HttpServerUtility.UrlTokenDecode? With: var pathEncoded = "aHR0cHM6Ly9mYWtlZC5ibG9iLmNvcmUud2luZG93cy5uZXQvcGRmYmxvYnMvYW5udWFsX3JlcG9ydF8yMDA5XzI0NTU20"; I have

Synonym Maps in Azure Search, synonym phrases

…衆ロ難τιáo~ 提交于 2020-01-05 06:32:03
问题 I'm trying to use synonym maps in Azure Search and i'm running into a problem. I want to have several words and phrases map into a single search query. In other words, when i search for either: product 123 , product0123 , product 0123 i want the search to return results for a query phrase: product123 . After reading the tutorial it all seemed pretty straight forward. I'm using .Net Azure.Search SDK 5.0 so i've done the following: var synonymMap = new SynonymMap { Name = "test-map", Format =

Synonym Maps in Azure Search, synonym phrases

☆樱花仙子☆ 提交于 2020-01-05 06:31:20
问题 I'm trying to use synonym maps in Azure Search and i'm running into a problem. I want to have several words and phrases map into a single search query. In other words, when i search for either: product 123 , product0123 , product 0123 i want the search to return results for a query phrase: product123 . After reading the tutorial it all seemed pretty straight forward. I'm using .Net Azure.Search SDK 5.0 so i've done the following: var synonymMap = new SynonymMap { Name = "test-map", Format =