I am using the Microsoft Graph API to allow users to search for emails within a specific mail folder. I am using the $search query parameter on the /users/{id}/mailFolders/{id}/messages endpoint, which works well for general keyword searches.
Here is a simplified example of my C# code using the Microsoft Graph SDK:
// C# using Microsoft.Graph SDK v5
var searchKeyword = "project budget";
var messages = await graphClient
.Users["user@example.com"]
.MailFolders["folderId"]
.Messages
.GetAsync((config) =>
{
config.QueryParameters.Search = searchKeyword;
config.QueryParameters.Top = 25;
// I also select specific properties I need
config.QueryParameters.Select = new string[] { "subject", "from", "receivedDateTime" };
});
What I know so far:
The $search
parameter is designed to function like the main search bar in Outlook, providing a user-friendly search across multiple fields simultaneously.
Based on the official documentation and various community sources, I understand that the search targets at least the following properties:
subject
body
from
toRecipients
, ccRecipients
, bccRecipients
attachments
(for supported file types like Office documents, PDFs, etc.)My Question:
While this is useful, I am looking for a definitive and exhaustive list of all properties that are indexed and included by default in a simple $search="keyword"
query.
My goal is to have a complete technical understanding so I can accurately document the feature for my users and stakeholders.
Specifically:
$search
parameter on the /messages
endpoint?categories
, specific Internet Message Headers, or other extended properties?I am aware that I can use Keyword Query Language (KQL) to explicitly target specific fields (e.g., subject:budget
), but my question is specifically about the default behavior of the $search
parameter when no fields are specified.
Thank you for any clarification you can provide.
When no search keyword is specified, the search is carried out on the default search properties of from
, subject
, and body
.
The table below shows an overview of the message properties supporting searching. During the searching you need to use a specific keyword related to each property.
Grahp property | Search keyword(s) | Is default |
---|---|---|
bccRecipients | bcc, participants, recipients | - |
body | body | YES |
bodyPreview | body | YES |
categories | category | - |
ccRecipients | cc, participants, recipients | - |
from | from, participants | YES |
hasAttachments | hasAttachment, hasAttachments | - |
importance | importance | - |
isRead | isRead | - |
receivedDateTime | received | - |
sender | from | - |
sentDateTime | sent | - |
subject | subject | YES |
toRecipients | to, participants, recipients | - |
uniqueBody | body | YES |
Check more in my article