Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/132.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Microsoft graph api 使用Microsoft Graph API进行精确文本搜索_Microsoft Graph Api_Onedrive_Microsoft Graph Files - Fatal编程技术网

Microsoft graph api 使用Microsoft Graph API进行精确文本搜索

Microsoft graph api 使用Microsoft Graph API进行精确文本搜索,microsoft-graph-api,onedrive,microsoft-graph-files,Microsoft Graph Api,Onedrive,Microsoft Graph Files,我们可以使用Microsoft Graph API进行精确的文本搜索吗 我知道搜索的终点是: GET /me/drive/root/search(q='{search-query}') 不清楚要传递给搜索查询(q)参数的内容 用于搜索项目的查询文本。可以跨多个字段匹配值,包括文件名、元数据和文件内容 我尝试过双引号格式 https://graph.microsoft.com/v1.0/me/drive/root/search(q='"Bob Bowen"') 和“+”格式 https://g

我们可以使用Microsoft Graph API进行精确的文本搜索吗

我知道搜索的终点是:

GET /me/drive/root/search(q='{search-query}')
不清楚要传递给搜索查询(
q
)参数的内容

用于搜索项目的查询文本。可以跨多个字段匹配值,包括文件名、元数据和文件内容

我尝试过双引号格式

https://graph.microsoft.com/v1.0/me/drive/root/search(q='"Bob Bowen"')
和“+”格式

https://graph.microsoft.com/v1.0/me/drive/root/search(q='Bob+Bowen')

我使用Microsoft Graph Explorer上的“Try it”按钮运行这些查询,我希望它们不会返回任何结果,因为“Bob Bowen”一词不应该出现在示例驱动器中。但我总是能找到一些文档,因为精确的文本搜索不起作用。

我只是碰巧找到了

IDriveItemSearchRequestBuilder searchRequest = graphServiceClient.Me.Drive.Root.Search(searchFile);

var searchResult = searchRequest.Request().GetAsync().Result.ToList();

在其他变体中,授权错误

对于有用的答案,需要扩展此反应(searchFile的内容是什么?)。解释为什么这是问题的答案。