I am observing a quite strange issue, with the sharepoint rest API
(SharePoint Online as well as onPrem).
We have a slightly bigger library (~100.000 documents) with some multi-level folder structure. I have two additional fields on the folder, let's call them CountryA
and CountryB
, both fields are indexed.
What I observe is the following:
/Items?$filter=(substringof('Ukraine',CountryA))&$select=ID (150 records)
/Items?$filter=(substringof('Spain',CountryB))&$select=ID (250 records)
/Items?$filter=(substringof('Ukraine',CountryA) and (substringof('Spain',CountryB))&$select=ID (100 records)
and now the very strange thing:
/Items?$filter=(substringof('Ukraine',CountryA) or (substringof('Spain',CountryB))&$select=ID
throws an Microsoft.SharePoint.SPQueryThrottledException
To be honest this doesn't make any sense to me; almost looks like a bug.. As I don't have much time, I "sorted" the issue by doing both single field queries rest queries in parallel and joining the result on the client side..
Anyhow any feedback is really appreciated; as I actually increase the load towards SharePoint by now throwing two rest calls in parallel on the server I just can't believe this is the "right" way to go?!