Reputation: 437
I'm struggling with Glass Mapper and can find little on Google. My class has a property that should get all descendant news articles:
[SitecoreQuery(".//*[@@templateid='{6F15C485-CA13-4352-A411-7F36447CC879}']", IsRelative = true, IsLazy = true)]
IEnumerable<IArticle> DescendantArticles { get; set; }
There should be about 850 arranged in folders named by year and then by month number but I am only getting 260 results. I have tried following the query format set out in Tutorial 7:
[SitecoreQuery("./*/*/*[@@templateid='{6F15C485-CA13-4352-A411-7F36447CC879}']", IsRelative = true, IsLazy = true)]
Still no dice. If I try:
[SitecoreQuery("./2015/*/*[@@te...
I will get all of 2015's articles, so they are all published but when trying to get the lot, I still only get the first 200 articles (2010-2011!). I have tried altering:
<setting name="Query.MaxItems" value="100" />
With no result. I fear I've missed something. Please help!
Upvotes: 1
Views: 344
Reputation: 16990
Since you are running a Sitecore Query the number of items returned is limited by the Query.MaxItems
setting:
<!-- Query.MaxItems
Specifies the max number of items in a query result set.
If the number is 0, all items are returned. This may affect system performance, if a
large query result is returned.
This also controls the number of items in Lookup, Multilist and Valuelookup fields.
Default value: 100
-->
<setting name="Query.MaxItems" value="100"/>
This value from Sitecore.config
is in turn patched by the setting in Sitecore.ExperienceExplorer.config
which sets the value to 260, this was updated in Sitecore 8.1. That is why you only have that many items returned.
Either increase this value or it would be better to reevaluate your code to use ContentSearch API. Turning this value up too high will negatively affect performance.
Upvotes: 4