I'm trying to add logic to my c# function app that does something similar to this test query I tried in Graph Explorer:
This is the response I get back (notice that it automatically fixed my typo and ran the search)
I'm trying to do this programmatically in c# but it doesn't correct my spelling. This is what my c# code looks like in part:
var requestBody = new Microsoft.Graph.Search.Query.QueryPostRequestBody
{
Requests = new List<SearchRequest>
{
new SearchRequest
{
EntityTypes = new List<EntityType?>
{
EntityType.DriveItem,
},
Query = new SearchQuery
{
QueryString = this.searchQuery,
},
Fields = new List<string>
{
"listId",
"author",
"title",
},
QueryAlterationOptions = new SearchAlterationOptions
{
EnableSuggestion = true,
EnableModification = true,
},
Region ="US"
},
},
};
var result = await graphClient.Search.Query.PostAsync(requestBody);
This is a screenshot of what I get back when I send this query to my app via postman:
I get an error that looks like this:
EDIT 1
Trying "NAM" for the region gives me this error:
It seems to me that the value
US
of theregion
property is not correct. Possible values for the region property are:Try to use one of the value above