You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure AI Search评分配置文件配置后报错,请求排查修复

问题修复方案

错误原因分析

你当前的评分配置错误在于tag评分函数的参数使用不当:

  • tagsParameter的作用是指定一个查询参数名称,用于搜索时动态传入要匹配的标签值,而非直接写入目标标签值reviewed。直接写固定值违反配置语法规则,导致索引保存失败。
  • 同时需确保source字段的filterable属性已设为true,tag评分函数依赖可过滤字段匹配值。

修复后的配置代码

将原tag函数部分修改为使用values指定固定匹配标签,调整后的完整评分配置如下:

"scoringProfiles": [
    {
      "name": "pub_house",
      "functionAggregation": "sum",
      "text": {
        "weights": {
          "content": 10,
          "title": 2
        }
      },
      "functions": [
        {
          "fieldName": "source",
          "interpolation": "constant",
          "type": "tag",
          "boost": 5,
          "freshness": null,
          "magnitude": null,
          "distance": null,
          "tag": {
            "values": ["reviewed"]
          }
        }
      ]
    }
  ],

额外检查项

  1. 确认source字段定义中filterable为true,示例字段定义:
"fields": [
  // 其他字段...
  {
    "name": "source",
    "type": "Edm.String",
    "filterable": true,
    "searchable": true // 根据需求设置,至少需filterable为true
  }
]
  1. 若需支持动态传入标签(而非固定匹配reviewed),则保留tagsParameter,查询时需通过指定参数传递值(比如查询时添加&source_tags=reviewed),此时配置应为:
"tag": {
  "tagsParameter": "source_tags"
}

是否为平台Bug?

不是平台Bug,属于配置语法使用错误,按上述调整后即可正常保存索引配置并实现预期排名提升效果。

内容的提问来源于stack exchange,提问作者R_Student

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 16:03:13