The ContentIterator.ProcessListItems gets the list items in a batch. If I specify the RowLimit on SPQuery, then it uses this as the count in the batch, but if I don't specify, it is getting 2000 items in the batch. Can anyone explain this? Also, if I want to implement paging using ContentIterator, it is by default getting all items in batches. Is there a way, wherein I can limit the number of items fetched using the ContentIterator? Also, is it possible to specify it to bring only a particular batch, instead of all batches? Please help.
When you specify RowLimit, it uses that to limit the batch size, but if you omit it, then it is using the threshold value set by the administrator, that is 2000 by default.
You can limit the results with the where clause of the SPQuery. That's how I've done paging - I was using a field in the query and limit the results to start from a specific value (i.e. ID > 20 with RowLimit = 20 gives back the results starting from the 'second page'. After I render the 'second page', I cancel the iterator).
You can't specify explicitly a batch, but you can "return" on an iteration until you get to the desired batch and cancel the iterator after you get it.