Graph API - use $search with multiple parameters

Donald Kim 1 Reputation point


I want to use $search ( with multiple parameters with OR statement, like this:$search="hello" or "good day"

But I can't find something helpful in documentation.

May be there is some way to use this with OR statement?

Microsoft Graph Search API
Microsoft Graph Search API
A Microsoft API that searches for information in email messages, returns messages ranked by relevance, and renders a dedicated search experience.
174 questions
Microsoft Graph Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
796 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Dev 106 Reputation points

    You can pass the OR statement between the condition followed with the "statement1" OR "statement2 and make sure you have space between statement1<space>OR<space>statement2"

    For my case below is the sample that worked.$search=%22jobTitle:u%22%20OR%20%22displayName:u%22

    For your case below should work$search="hello" OR "good day"

    Note : OR should be in capital.

    0 comments No comments

  2. Danstan Onyango 3,241 Reputation points

    For this kind of search, you should use the search API. Here is a example to search your files.

        "requests": [  
                "entityTypes": [  
                "query": {  
                    "queryString": "hello OR good day"  
    0 comments No comments