I'm trying to list all documents that were (ever) modified by a specific user, using a CAML query like this one:
var query = new CamlQuery{ ViewXml =
"<View Scope='Recursive'>" +
"<Query>" +
"<Where>" +
"<Contains>" +
"<FieldRef Name='Editor' LookupValue='TRUE' />" +
"<Value Type='Text'>Frank van Puffelen</Value>" +
"</Contains>" +
"</Where>" +
"</Query>" +
"</View>" };
On an item level there are the Editor and Author fields that seem promising. But unfortunately the Editor field seems to only identify the person who modified the most recent version, while I am looking for documents that were modified at any point by this user.
Say I have a document with this version history:
- John Doe
- Frank van Puffelen
- John Doe
Then the item will show "John Doe" as both its Author and its Editor. So this document will not show up when I search for items modified by "Frank van Puffelen" with the CAML query above.
So far the only way I've been able to get the necessary information is to open the version history of each item. But that is of course quite costly and I'd prefer to prevent it if possible.
Is there any way to search the version history using CAML like this? Or is there another search technique that would get me the list of documents that a specific user contributed to?