使用“以…开始”的筛选器来搜索 SharePoint 中的字段。

huangapple go评论68阅读模式
英文:

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 

huangapple
  • 本文由 发表于 2023年6月22日 17:53:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76530662.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定