I am using the following Query to retrieve the latest documents of the current user:
<Where> <And> <Eq> <FieldRef Name='FSObjType'></FieldRef> <Value Type='Text'>0</Value> </Eq> <Or><Eq> <FieldRef Name='Author' /> <Value Type='Integer'><UserID/></Value> </Eq> <Eq> <FieldRef Name='Editor'/> <Value Type='Integer'><UserID/></Value> </Eq> </Or> </And> </Where> <OrderBy> <FieldRef Name="Modified" Ascending="FALSE"/> </OrderBy>
It is failing if the total number of documents in the site collection is higher than the threshold limit, even if the return result of the above query is only a few documents.
How to change the above query so that i don't risk exceeding the threshold.
Example, user1 has changed 5 documents in a list that contains 7000 documents. i want to display those 5 documents using the above query. If the list threshold is less than 7000, i get an exception. How to change the above query so not to exceed the threshold limit?