I'm not sure I have a syntax error here in my CAML Query or I am misunderstanding how the API works but I have a very large document library in which I am trying to identify items that have had no compliance / retention label set.
My query is trying to return any item in the library that does not have the compliance retention label set to "Test". This is the query but regardless of rowlimit, the console app returns the threshold error... "The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator."
<View Scope='RecursiveAll'><RowLimit>20</RowLimit><Query><Where><Neq><FieldRef Name='_ComplianceTag'/><Value Type='String'>Test</Value></Neq></Where></Query></View>
I have been trying the most basic query and I can confirm this works...
<View Scope='RecursiveAll'><RowLimit>20</RowLimit></View>
But as soon as I add element to the CAML, I get the error. It seems once the query is added it ignores my row limit. The plan is to bring the items back in small batches and apply the label. I've already built a console app which uses the SetComplianceTag to library method. This applies Tags to everything in the library but unfortunately my library is so large we found it missed a few.
Any insights would be much appreciated.