我使用Graph SDK在SharePoint中搜索文件。可以只按名字搜索吗?
var request = _graphServiceClient
.Drives[id]
.Root
.Search($"{searched}")
.Request();
上面的请求返回在内容或元数据中具有给定短语的文件,我需要在代码中按名称过滤它们。如果可能的话,我想避免这种做法。
您可以使用类似以下的搜索api
POST /search/query
Content-Type: application/json
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "contoso"
}
}
]
}
这是的详细信息
https://learn.microsoft.com/en-us/graph/search-concept-files