评分配置文件必须与索引同时创建:
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);
}
}