C# RedDog.Search无法发出搜索请求

C# RedDog.Search无法发出搜索请求,c#,.net,azure-cognitive-search,C#,.net,Azure Cognitive Search,我有一个应用程序,我需要在RedDog.search sdk(版本0.5.3-pre)的帮助下使用azure search。尽管我能够使用IndexManagementClient创建索引和上载文档,但在尝试使用IndexQueryClient进行简单搜索时,我总是收到一个挂起的请求。这是我的代码: ApiConnection connection = ApiConnection.Create("my-service", "my-key"); var client = new IndexQue

我有一个应用程序,我需要在RedDog.search sdk(版本0.5.3-pre)的帮助下使用azure search。尽管我能够使用IndexManagementClient创建索引和上载文档,但在尝试使用IndexQueryClient进行简单搜索时,我总是收到一个挂起的请求。这是我的代码:

ApiConnection connection = ApiConnection.Create("my-service", "my-key");

var client = new IndexQueryClient(connection);

try
{
  var results = await client.SearchAsync("companies", new SearchQuery()
    .OrderBy("name")
    .Count(true));

  foreach (var doc in results.Body.Records)
  {
    // Do something with the properties: result.Properties["title"], result.Properties["description"]
  }
}
catch (Exception ex)
{
   throw ex;
}
foreach循环和catch块都不会被击中。用于连接的服务名称和密钥是正确的,因为我已尝试在microsoft azure search sdk中使用它们,并且效果良好

以下是我的索引的映射方式:

id Edm.String Key, Searchable, Sortable, Retrievable
name Edm.String Searchable, Filterable, Sortable, Retrievable
adminEmails Collection(Edm.String) Searchable, Filterable, Retrievable
hrEmails Collection(Edm.String) Searchable, Filterable, Retrievable
description Edm.String Searchable, Filterable, Sortable, Retrievable
shortDescription Edm.String Searchable, Filterable, Sortable, Retrievable
image Edm.String Retrievable
thumbnail Edm.String Retrievable
country Edm.Int32 Filterable, Sortable, Retrievable
city Edm.String Searchable, Filterable, Sortable, Retrievable
postalCode Edm.String Searchable, Filterable, Sortable, Retrievable
street Edm.String Retrievable
number Edm.String Retrievable
box Edm.String Retrievable
rating Edm.Int32 Filterable, Sortable, Retrievable
boostFactor Edm.Int32 Filterable, Facetable, Sortable, Retrievable
tags Collection(Edm.String) Searchable, Filterable, Facetable, Retrievable
deleted Edm.Boolean Filterable, Sortable, Retrievable
addedDate Edm.DateTimeOffset Filterable, Sortable, Retrievable
changedDate Edm.DateTimeOffset Filterable, Sortable, Retrievable
banExpirationDate Edm.DateTimeOffset Filterable, Sortable, Retrievable
users Collection(Edm.String) Retrievable
currentJobs Collection(Edm.String) Retrievable
finishedJobs Collection(Edm.String) Retrievable
finishedJobsCount Edm.Int32 Filterable, Sortable, Retrievable
recommendations Collection(Edm.String) Searchable, Filterable, Retrievable
websites Collection(Edm.String) Searchable, Filterable, Retrievable

scoring profiles:
commonDields default profile fields: name (weight 1.5), shortDescription (weight 1.5), description (weight 1.5)     and websites (weight 1.5) no functions -> function aggregation sum
mostRecent type: Freshness, field: changedDate, interpolation: Linear, boost: 1.5
byRating type: Magnitude, field: rating, interpolation: Linear, boost: 1.5
byBoostFactor type: Magnitude, field: boostFactor, interpolation: Linear, boost: 3
byTags type: Tag, field: tags, interpolation: Linear, boost: 1.5
我做错什么了吗?或者Azure搜索门户中是否有需要更新的设置


谢谢

请注意,RedDog.Search是Microsoft不支持的第三方SDK。这是Azure搜索团队的官方SDK:@Bruce Johnston-我知道这是一个第三方SDK,但我已经投入了大量的时间使它能够使用面向对象的泛型类来创建索引和上传文档,我不想失去它。这是我不想切换到microsoft SDK的唯一原因。我们可以在SDK中添加一些功能,使其更易于迁移?我不知道这些功能是否能帮助所有人,但是我可以告诉你我做了什么使我的生活变得简单:-为了给一个类编制索引,我做了以下几点:我让它实现了一个接口,在这个接口中我可以设置索引名称、评分配置文件和建议。然后,我创建了自定义属性属性,以存储属性名称和所需的属性(IsKey、IsSearchable等)。我在通用存储库中解析了所有内容,这样我就不必编写多个函数来为不同的类创建索引(而且,如果我决定在某个时间点添加其他属性,这些函数也必须更改)。