Unexpected microsoft external search aggregation values

Viewed 88

We have an Microsoft Search instance for crawling one custom app : https://docs.microsoft.com/en-us/microsoftsearch/connectors-overview

Query & display is working as expected but aggregation provides wrong results

query JSON : https://graph.microsoft.com/v1.0/search/query

select title + submitter and aggregation on submitter

       "fields": [
            "title",
            "submitter"
        ],
        "aggregations": [
            {
                "field": "submitter",
                "size": 1,
                "bucketDefinition": {
                    "sortBy": "keyAsString",
                    "isDescending": true,
                    "minimumCount": 0
                }
            }
        ]

JSON response

submitter property is correctly returned with Firstname Lastname on row 0 but aggregate is lowercase and middle space trimmed 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\""
                            }
                        ]
                    }
                ]
            }
        ]

reproducible in Microsoft Graph Explorer (a bit obfuscated)

  1. result with space
  2. aggregation concatenated in lowercase

enter image description here

1 Answers

Rootcause has been identified as submitter property wasn't created with flag refinable

   {
        "name": "submitter",
        "type": "String",
        "isSearchable": "true",
        "isQueryable": "true",
        "isRetrievable": "true"
        "isRefinable": "false"
    }

as a consequence, output was incorrect.

testing with refinable = true provides correct aggregation value (1 = non refinable, 2 = refinable).

small note : refinable properties can't be searchable enter image description here

Related