Mar*_*pez 0 azure-cognitive-search azure-search-.net-sdk
我找不到如何使用 .NET 客户端进行 Azure 搜索来添加评分配置文件。是的,我知道有一个文档可以使用 REST API 来完成,谢谢。
评分配置文件必须与索引同时创建:
private async Task CreateIndexAsync<T>(string index) where T : class
{
var definition = new Index()
{
Name = index,
Fields = FieldBuilder.BuildForType<T>(),
ScoringProfiles = new List<ScoringProfile>
{
//your scoring profiles here
}
};
if (!_adminServiceClient.Indexes.Exists(index))
{
await _adminServiceClient.Indexes.CreateAsync(definition);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
187 次 |
| 最近记录: |