【发布时间】:2017-02-25 16:37:16
【问题描述】:
我已通过 Azure 搜索 SDK 创建了一个数据源。
来自 Azure sql 的数据源,它是一个视图。
我想设置 DataChangeDetectionPolicy 和 DataDeletionDetectionPolicy, 但我不明白如何设置这两个属性。
当我认为预览版 sdk 不支持这两个属性时,我尝试使用 REST API 来解决这个问题。
我读了这篇文章: MSDN Create Data Source (Azure Search Service REST API)
并使用 Chrome Extension Postman 设置数据更改检测策略。
网址:https://domain.search.windows.net/datasources/temp1?api-version=2015-02-28
正文:
{
"@odata.type" : "#Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy",
"highWaterMarkColumnName" : "ModifiedDatetime"
}
然后我收到 400 错误请求。
错误信息:
{
"error":
{
"code": "",
"message": "The request is invalid. Details: dataSource : Incompatible type kinds were found. The type 'Microsoft.Azure.Search.HighWaterMarkChangeDetectionPolicy' was found to be of kind 'Complex' instead of the expected kind 'Entity'.\r\n"
}
}
所以,我有两个问题。
1.SDK现在不支持这个功能了吗?
2.使用REST API,错误如何解决?
感谢回复。
【问题讨论】:
标签: c# azure azure-cognitive-search