我们可以使用 Microsoft Graph API 进行精确的文本搜索吗?
我知道搜索的端点是:
GET /me/drive/root/search(q='{search-query}')
The documentation不清楚将什么传递到搜索查询 (q
) 参数中。
The query text used to search for items. Values may be matched across several fields including filename, metadata, and file content.
我试过双引号格式
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 上的“试用”按钮运行这些查询,我希望它们不会返回任何内容,因为“Bob Bowen”一词不应存在于示例驱动器中。但我总是得到一些文档匹配,因为精确的文本搜索不起作用。
最佳答案
我刚好有
IDriveItemSearchRequestBuilder searchRequest = graphServiceClient.Me.Drive.Root.Search(searchFile);
var searchResult = searchRequest.Request().GetAsync().Result.ToList();
在其他变体中,授权错误
关于microsoft-graph-api - 使用 Microsoft Graph API 进行精确文本搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58035855/