简体   繁体   English

MS SharePoint 搜索 API 没有返回所有文件

[英]MS SharePoint Search API doesn't return all files

I'm using the MS SharePoint Search API over Rest to get the file paths to all PDF files on a SharePoint site.我正在使用 MS SharePoint 在 Rest 上搜索 API 来获取 SharePoint 站点上所有 PDF 文件的文件路径。 I use the Search API iterative, because there are more than 5000 file on the site.我使用搜索 API 迭代,因为站点上有超过 5000 个文件。

What I'm doing is:我正在做的是:

https://[root_url]/_api/search/query?QueryText='*+site:"[root_url]/[listname]"'
&RowLimit=500&RowsPerPage=500&StartRow=0&Refiners='fileType'
&RefinementFilters='fileType:pdf'&TrimDuplicates=false

...until the list is empty. ...直到列表为空。

The listname contain a whitespace.The query works, it returns 2661 files.列表名包含一个空格。查询有效,它返回 2661 个文件。 TrimDuplicates does its job somehow. TrimDuplicates 以某种方式完成它的工作。 Without TrimDuplicates, the query returns only 1169 files.如果没有 TrimDuplicates,查询仅返回 1169 个文件。

Some of the missing files are duplicates.一些丢失的文件是重复的。 They are at different places with the same name and content.它们位于不同的地方,具有相同的名称和内容。 But some files are missing at all.但是有些文件根本就不见了。

I can download the missing files via:我可以通过以下方式下载丢失的文件:

https://[root_url]/_api/web/GetFolderByServerRelativeUrl('[path]')/Files('[filename]')/$value

Any hints?有什么提示吗?

You could use the search query tool to query the missing document (eg by title or path) and compare the managed properties with your filters in the query.您可以使用搜索查询工具来查询丢失的文档(例如按标题或路径)并将托管属性与查询中的过滤器进行比较。 If you cannot get the file via search query at all, please ensure that the list is not excluded from search index and a crawl indexed the document.如果您根本无法通过搜索查询获取文件,请确保该列表未从搜索索引中排除并且爬网索引了该文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM