将 Azure 搜索中的新字段设置为默认值

Set new field in azure search to default value

我正在使用 Azure 搜索,当我添加 一个新字段时,它变为空。
有没有办法设置默认值?

PUT {{servicename}}/indexes/{{indexname}}?api-version=2019-05-06
Content-Type: application/json   
api-key: {{adminkey}}

{  
  "fields": [
    {  
      "name": "rid",
      "type": "Edm.String",
      "searchable": false,
      "filterable": false,
      "sortable": false,
      "facetable": false,
      "key": true
    },   
    {
      "name": "NewField",
      "type": "Edm.Boolean"
    }
}

搜索结果是

{
    "@odata.context": "https://whatever.search.windows.net/indexes('indexname')/$metadata#docs(*)",
    "value": [
        {
            "@search.score": 0.55735236,
            "rid": "asdfasdf",
            "Email": null
        }
    ]
}

Is there a way to have a default value?

基于documentation,没有

添加新字段后,您必须手动 update 现有文档来为添加的字段设置值。如文档中所述,您可以将 merge 用作 @search.action 以仅更新新添加的字段。