【问题标题】:Graph query on SharePoint Libraray with Paging带有分页的 SharePoint 库上的图形查询
【发布时间】:2021-08-20 23:19:08
【问题描述】:

我有超过 5000 个文件的库 使用时:

https://graph.microsoft.com/v1.0/sites/3a8180fe-ca21-40a8-81e6-0950f5966f07/lists/DPC Documents/Items?top=499&$expand=fields&$filter=fields/FileLeafRef eq '0100.009_Client Name_Physician Name_FMV Exhibits_466689.XLSX'

我收到错误“请求无法处理,因为它使用了太多资源” 我可以要求分页吗?

顺便说一句,等效的 SharePoint REST 调用返回“禁止尝试的操作,因为它超出了列表视图阈值。”

因此,无法在包含超过 5000 个项目的列表中查找项目。 我注意到我无法在此类库中以编程方式发布主要版本。

我的 MS 不支持任何 API 来处理这个?

谢谢

【问题讨论】:

  • 您能否分享 ms graph 和 sharepoint api 的请求 ID 和响应,以便我们调查一下?
  • 发布错误(等待 projectWebSite.getFileByServerRelativeUrl("/teams/" + dItem.dpcProjectNumber + "/DPCDocuments/" + fileName).publish("Rename Existing File"); )是“错误在可查询 [500] Internal Server Error ::> {"odata.error":{"code":"-2147024860, Microsoft.SharePoint.SPQueryThrottledException","message":{"lang":"en-US 中发出 HttpClient 请求","value":"尝试的操作被禁止,因为它超过了列表视图阈值。"}}}"
  • SP REST 错误 (/_api/web/lists/getByTitle('DPC%20Documents')/items?$expand=File&$select=Id%2CRequestNumber%2CModified%2CFile%2FName&$top =1000&$filter=FileLeafRef%20eq%20%27ReplaceMe.docx%27) 是:"{ "odata.error": { "code": "-2147024860, Microsoft.SharePoint.SPQueryThrottledException", "message": { "lang ": "en-US", "value": "尝试的操作被禁止,因为它超过了列表视图阈值。" } } }"
  • 带有标题 Prefer:HonorNonIndexedQueriesWarningMayFailRandomly 的 Graph 错误 (graph.microsoft.com/v1.0/sites/… Documents/items?expand=Fields&$top=1&$filter=fields/FileLeafRef eq 'SRH ASC and Endo Development Proposal.docx')是:在下一条评论中
  • 图形错误:""error": { "code": "notSupported", "message": "请求无法处理,因为它使用了太多资源", "innerError": { "date" :“2021-06-03T13:44:54”、“请求 ID”:“d91af364-86c5-4c57-acb3-7a2ef1db4150”、“客户端请求 ID”:“f086a047-cf9e-ae28-0287-10d91f26db4f” } }" 谢谢

标签: microsoft-graph-api sharepoint-online sharepoint-rest-api


【解决方案1】:

这很可能是由于您在 doc 库中有超过 5000 个文件并且过滤列 FileLeafRef 未编入索引(您也无法为此列添加索引)。我在使用自定义元数据列进行过滤时遇到了同样的错误,但幸运的是,在将索引添加到列之后,错误就消失了。解决问题的唯一方法是不要使用 FileLeafRef 作为过滤列,而是在过滤条件中使用 Title 列,确保 Title 列填充了文档名称并且列被索引。

【讨论】:

    猜你喜欢
    • 2021-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-02
    • 2017-10-04
    相关资源
    最近更新 更多