首页 > 解决方案 > 带有分页的 SharePoint Libraray 上的图形查询

问题描述

我有包含超过 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'

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

BTW 等效的 SharePoint REST 调用返回“禁止尝试的操作,因为它超过了列表视图阈值。”

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

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

谢谢

标签: microsoft-graph-apisharepoint-onlinesharepoint-rest-api

解决方案


This is most probably due to the reason that you have more than 5000 files in the doc library and the filter column FileLeafRef is not indexed (you cannot add index this column either). I encountered same error when filtering with a custom metadata column but fortunately after adding the index to the column, the error went away. The only solution to your problem is not to use FileLeafRef as your filter column but use the Title column in the filter condition, after ensuring that Title column is populated with name of the document and the column is indexed.


推荐阅读