Forum Discussion

Eswar2015's avatar
Eswar2015
Copper Contributor
Jul 19, 2019

Trying to construct a rest url based on a particular taxonamy value equal to giving error.

Dear All,

 

Trying to construct a rest URL based on taxonamy value and getting the error of list threshold value( Please note list has more than 1 lakh items and need to get items on basis of 5k or batches).

 

This is the url i am using:

 

{YourSiteCollectionUrl}/_api/lists/getbytitle('Student%20%20Admissions')/Items?%24skiptoken=Paged%3DTRUE%26p_ID%3D1&%24top=5000&$filter=TaxCatchAll/Term eq 'Sample'

 

PFA file.

 

Kindly Suggest.

 

Regards,

Eswar

 

  • paulpascha's avatar
    paulpascha
    Bronze Contributor

    Eswar2015you could first try adding an index on your taxonomy field in an attempt to get around the threshold and see if it helps. It might be you have to incorporate additional filters and sorting in your query to limit the result set.

     

    Could you elaborate on the reason why you need to query for 5000 items at once? A better aproach might be to query for your data in smaller batches. You might still need a combination of indexes, filtering and sorting though to prevent SharePoint having to evaluate more than 5000 items before being able to return your requested items.

     

    More details on how to manage large lists in general can be found here:

    https://support.office.com/en-us/article/manage-large-lists-and-libraries-in-sharepoint-b8588dae-9387-48c2-9248-c24122f07c59#ID0EAABAAA=Online

     

    • Eswar2015's avatar
      Eswar2015
      Copper Contributor

      paulpascha ,

       

      Greetings and thanks for quick reply, currently the document library has 1.2 lakh items as per the business requirement.

       

      Even if we do the reindex as mentioned the items are more than 5 k items.

       

      Can you please suggest the Rest query, based on the taxonamy.

       

      As discussed this is the URL :

       

      {YourSiteCollectionUrl}/_api/lists/getbytitle('Student%20%20Admissions')/Items?%24skiptoken=Paged%3DTRUE%26p_ID%3D1&%24top=5000&$filter=TaxCatchAll/Term eq 'Sample'

       

      Kindly suggest for any sorting to get the results, or batch wise processing of request through REST API

       

      Regards, 

      Eswar T

Resources