0

I have gone through following question

SharePoint REST API call with more than 500 rows

We want to use Search API with REST API or JSOM. We have large lists in SharePoint. The data can be 100000 or more items in a single list. There are multiple large lists. In some scenarios search API which will search across all lists and in some scenarios it will also search in a single lists.

So like REST API does it throw threshold error for more than 5000 matched items or does SharePoint Search REST API throws any threshold limit in any case?

Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
  • Are you asking if SharePoint search stops search after 5000 items found? If so, then no it does not. I just did a search that reported 122,500 items found. It's just a matter of clicking next a lot of times. (or doing your paging using REST) – Mike Smith - MCT Feb 11 '18 at 22:52
  • @MikeSmith-MCT-MVP Lets consider list view threshold limit of a list is 5000 and that list contains more than 100000 items. Suppose if we use Search API on that list and number of matches are 10000 items then in that case will we get threshold error? If not then should we need to iterate over matched list items by 500 at a time so that we will get all 10000 items(As mentioned in the link provided in question) ? – Shailesh Jaiswal Feb 20 '18 at 19:05
  • @MikeSmith-MCT-MVP Also suppose that all the required columns are indexed – Shailesh Jaiswal Feb 20 '18 at 19:11
  • 1
    Search and a list are two different things... List content is stored SQL tables and SQL is what has the 5000 limit. Search content is stored in both proprietary files and some SQL tables. But in general, search does not have a 5000 limit. (Side note... data in SharePoint is, generally speaking, stored twice. Once in a list or library, and again in the search indexes.) The data from the Search API is not being pulled from the original list. (Lots of fun issues with this, such as how Search treats some non-duplicates as duplicates.) – Mike Smith - MCT Feb 21 '18 at 00:14
  • 1
    (cont.) For 100% complete data from a list, access the original list. For quick results from multiple lists, libraries and site collections, use search. Issues and restrictions in one rarely impact the other. – Mike Smith - MCT Feb 21 '18 at 00:16
  • @MikeSmith-MCT-MVP It means SharePoint list level API(without Search API) like mysiteUrl/_api/lists/getbytitle('Listname')/items? will throw threshold error when matched list items are more than 5000 because it pulls records directly from list and SharePoint REST Search API like mysiteUrl/_api/search/query?querytext='test' will not throw threshold error when matched list items are more than 5000 because it pulls records from search index – Shailesh Jaiswal Feb 21 '18 at 19:09
  • Please correct me if I am wrong – Shailesh Jaiswal Feb 21 '18 at 19:23
  • You are correct. – Mike Smith - MCT Feb 21 '18 at 21:47

1 Answers1

0

As Mike pointed out, I'm not aware of any limitations in terms of API's for search in SharePoint. You will have to make a lot of sub requests to retrieve all the items if you need to do so (but generally speaking, it'd probably be better to have a more complex query, retrieving less items and giving more work to the search engine). More details on how you can paginate (REST) here.
Keep in mind that your search service application needs to be properly designed to accept all the items otherwise it might stop indexing new items. (if you're on prem. or doing hybrid)

baywet
  • 4,377
  • 4
  • 20
  • 49