【发布时间】:2020-10-01 03:17:19
【问题描述】:
我正在尝试在 Azure 认知搜索中进行分面搜索。我正在使用邮递员(和 curl)进行测试。
有一个字段state_name 是可分面的。在https://docs.microsoft.com/en-us/rest/api/searchservice/search-documents 之后,如果我将 POST 请求有效负载发送为:
{
"facets": "state_name"
}
它返回此错误:
{
"error": {
"code": "",
"message": "The request is invalid. Details: parameters : When trying to read a null collection parameter value in JSON Light, a node of type 'PrimitiveValue' with the value 'state_name' was read from the JSON reader; however, a primitive 'null' value was expected.\r\n"
}
}
进行构面搜索的正确方法是什么?
更新:
payload中的facets应该是一个数组:
{
"facets": ["state_name"]
}
如https://docs.microsoft.com/en-us/rest/api/searchservice/search-documents#bkmk_examples所示
【问题讨论】:
标签: azure curl postman azure-cognitive-search