英文:
Use starts with filter for a field in Share Point search
问题
我正在尝试使用以下URL在SharePoint网站中进行搜索:
> https://graph.microsoft.com/v1.0/sites?$filter=startswith(displayName, 'C')
但是出现了以下错误:
> {
> "error": {
> "code": "invalidRequest",
> "message": "无法枚举站点",
> "innerError": {
> "date": "2023-06-22T09:41:39",
> "request-id": "101e303a-f611-4ec4-8536-f88555d49c68",
> "client-request-id": "101e303a-f611-4ec4-8536-f88555d49c68"
> }
> }
>}
是否有办法在搜索中使用startswith?
我期望能够获取displayName以'C'开头的结果。
英文:
I am trying to search in share point site using the url
> https://graph.microsoft.com/v1.0/sites?$filter=startswith(displayName, 'C')
But getting a
> {
> "error": {
> "code": "invalidRequest",
> "message": "Cannot enumerate sites",
> "innerError": {
> "date": "2023-06-22T09:41:39",
> "request-id": "101e303a-f611-4ec4-8536-f88555d49c68",
> "client-request-id": "101e303a-f611-4ec4-8536-f88555d49c68"
> }
> }
>}
Is there any way to use startswith in search
I am expecting to get the results with displayName starts with 'C'
答案1
得分: 1
你只能搜索匹配提供的关键字的 SharePoint 租户站点。它会搜索多个属性。
https://graph.microsoft.com/v1.0/sites?search=c*
可能需要在客户端上进行额外的筛选。我会返回所有站点的 id 和 displayName,并在客户端上筛选站点。
https://graph.microsoft.com/v1.0/sites?search=*&$select=displayName,id
英文:
You can only search across a SharePoint tenant for sites that match keywords provided. It searches across multiple properties.
https://graph.microsoft.com/v1.0/sites?search=c*
Probably additional filtering on the client is necessary. I would return id and displayName for all sites and filter the sites on the client.
https://graph.microsoft.com/v1.0/sites?search=*&$select=displayName,id
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论