意外的 Microsoft 外部搜索聚合值
Unexpected microsoft external search aggregation values
我们有一个用于抓取一个自定义应用程序的 Microsoft 搜索实例:https://docs.microsoft.com/en-us/microsoftsearch/connectors-overview
查询和显示按预期工作,但聚合提供了错误的结果
查询 JSON : https://graph.microsoft.com/v1.0/search/query
select title
+ submitter
和 submitter
上的聚合
"fields": [
"title",
"submitter"
],
"aggregations": [
{
"field": "submitter",
"size": 1,
"bucketDefinition": {
"sortBy": "keyAsString",
"isDescending": true,
"minimumCount": 0
}
}
]
JSON 回应
submitter
属性 正确返回第 0 行 Firstname Lastname
但 aggregate
是小写和中间 space 修剪 firstnamelastname
"hitsContainers": [
{
"total": 1,
"moreResultsAvailable": false,
"hits": [
{
"hitId": "xxxx",
"contentSource": "ConnectionId",
"rank": 1,
"summary": "New service / <c0>business</c0> <c0>model</c0> <c0>design</c0> <ddd/>",
"resource": {
"@odata.type": "#microsoft.graph.externalConnectors.externalItem",
"properties": {
"title": "New service / business model design",
"submitter": "Firstname Lastname"
}
}
}
],
"aggregations": [
{
"field": "submitter",
"buckets": [
{
"key": "firstnamelastname",
"count": 1,
"aggregationFilterToken": "\"ǂǂ696c736573706f656c73747261\""
}
]
}
]
}
]
可在 Microsoft Graph Explorer 中重现(有点混淆)
- 结果 space
- 以小写字母串联的聚合
根本原因已确定为 submitter
属性 未使用标记 refinable
创建
{
"name": "submitter",
"type": "String",
"isSearchable": "true",
"isQueryable": "true",
"isRetrievable": "true"
"isRefinable": "false"
}
因此,输出不正确。
使用 refinable = true
进行的测试提供了正确的聚合值(1 = 不可精炼,2 = 可精炼)。
小提示:无法搜索可精炼属性
我们有一个用于抓取一个自定义应用程序的 Microsoft 搜索实例:https://docs.microsoft.com/en-us/microsoftsearch/connectors-overview
查询和显示按预期工作,但聚合提供了错误的结果
查询 JSON : https://graph.microsoft.com/v1.0/search/query
select title
+ submitter
和 submitter
"fields": [
"title",
"submitter"
],
"aggregations": [
{
"field": "submitter",
"size": 1,
"bucketDefinition": {
"sortBy": "keyAsString",
"isDescending": true,
"minimumCount": 0
}
}
]
JSON 回应
submitter
属性 正确返回第 0 行 Firstname Lastname
但 aggregate
是小写和中间 space 修剪 firstnamelastname
"hitsContainers": [
{
"total": 1,
"moreResultsAvailable": false,
"hits": [
{
"hitId": "xxxx",
"contentSource": "ConnectionId",
"rank": 1,
"summary": "New service / <c0>business</c0> <c0>model</c0> <c0>design</c0> <ddd/>",
"resource": {
"@odata.type": "#microsoft.graph.externalConnectors.externalItem",
"properties": {
"title": "New service / business model design",
"submitter": "Firstname Lastname"
}
}
}
],
"aggregations": [
{
"field": "submitter",
"buckets": [
{
"key": "firstnamelastname",
"count": 1,
"aggregationFilterToken": "\"ǂǂ696c736573706f656c73747261\""
}
]
}
]
}
]
可在 Microsoft Graph Explorer 中重现(有点混淆)
- 结果 space
- 以小写字母串联的聚合
根本原因已确定为 submitter
属性 未使用标记 refinable
{
"name": "submitter",
"type": "String",
"isSearchable": "true",
"isQueryable": "true",
"isRetrievable": "true"
"isRefinable": "false"
}
因此,输出不正确。
使用 refinable = true
进行的测试提供了正确的聚合值(1 = 不可精炼,2 = 可精炼)。
小提示:无法搜索可精炼属性