I'm trying to use CrossListQueryInfo to query all Pages Libraries (ServerTemplate 850) across the site collection for a particular custom content type. However, specifying the content type in the query returns no results.
If I leave out the content type clause, results do come back, so the problem probably doesn't lie in the ViewFields.
I suspect my Content Type is broken somehow (filtering on another custom content type works perfectly) but I have no idea where to start.
Query:
<Where>
<Eq>
<FieldRef Name='ContentType' />
<Value Type='Text'>Custom News Article</Value>
</Eq>
</Where>
<OrderBy>
<FieldRef Name=\"ArticleStartDate\" Ascending=\"FALSE\"></FieldRef>
</OrderBy>
Code:
CrossListQueryInfo query1 = new CrossListQueryInfo();
query1.Query = clause.ToString(); // See above
if (rowLimit > 0) query1.RowLimit = rowLimit;
query1.ViewFields = viewFields;
query1.Lists = string.Format("<Lists ServerTemplate=\"850\" />");
query1.Webs = "<Webs Scope=\"SiteCollection\" />";
query1.WebUrl = SPContext.Current.Site.RootWeb.ServerRelativeUrl;