Graph Search people emailAddresses contains hidden unicode characters

Jonas 20 Reputation points
2023-03-04T18:55:46.45+00:00

Hello!

I know search for people is still in beta, but we are preparing to migrate to Graph Search API.

We got an issue, when we are searching and the search query is in the email field, then there is a unicode character before and after the word, as if it is supposed to be used for highlighting. The unicode characters seems to be U+E001 and U+E002.

Here is an example:

POST https://graph.microsoft.com/beta/search/query

BODY

{
    "requests": [
        {
            "entityTypes": [
                "person"
            ],
            "query": {
                "queryString": "jonas"
            },
            "Fields": [
                "DisplayName",
                "EmailAddresses"
            ],
            "Provenances": [
                "Directory"
            ]
        }
    ]
}

Response

{
    "value": [
        {
            "hitsContainers": [
                {
                    "hits": [
                        {
                            "hitId": "",
                            "rank": 1,
                            "summary": "",
                            "resource": {
                                "@odata.type": "#microsoft.graph.person",
                                "displayName": "Jonas",
                                "emailAddresses": [
                                    {
                                        "address": "jonas.******@company.se",
                                        "rank": 1
                                    }
                                ]
                            }
                        }
                    ],
                    "total": 1,
                    "moreResultsAvailable": false
                }
            ]
        }
    ],
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.searchResponse)"
}

I ask because I can not find any information about this. Are they supposed to be used for highlight? If so, should we expect them to be in other fields too? (I have not seen them in any other field).

Right now, we need to handle these characters to be able to display the email address correct.

Sincerely,
Jonas

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,282 questions
0 comments No comments
{count} votes

Accepted answer
  1. CharanyaB-MSFT 1,891 Reputation points Microsoft External Staff
    2023-03-06T16:02:55.01+00:00

    Hello @Jonas,

    Thanks for reaching out!

    I am able to reproduce your issue locally, and it seems to be a bug, as the emailAddress is appended with extra characters.

    Since, this seems to be a bug, I would recommend you report this by raising a support case with Microsoft. You can raise support ticket from http://aad.portal.azure.com or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.