int postCount; var posts = PostService.Instance.GetPosts(IPublishedContentHelper.GetNode((int)Model.Id), tag, label, author, searchTerm, commenter, year, month, day, out postCount).Skip((page - 1) * itemsPerPage).Take(itemsPerPage).ToIPublishedContent(true);
Looks like postCount contains count of all posts, even not published ones. I'm trying to prepare my publishing ahead, and my first page is now empty. (while I just have 1 published record)
I'm actually quick-fixing it by setting big items-per-page for now while I'm waiting for a good fix.
One of the ways I found is to set supportUnpublished="false" in Examine config. I totally don't understand what other things it might influence, I will not use this solution.
Other good thing would be to change your code like private IEnumerable<DynamicNode> GetDescendentsOrSelf( ... if (child.NodeTypeAlias == targetAlias && child.SomeWayToKnowIsNodePublished)
But there are no such property I found. And I totally thought Nodes are some active entities that are in cache or something, and they must be published already to be there. Document type, on other hand, does have IsPublished boolean, according to manual.
That code is depressing me. I was sure it just must be simple 10 lines of code to implement blog backend on CMS...
Thanks for reporting this... the issue is that i'm getting examine results using the internal index which indexes published and unpublished nodes. I thought the "ToIPublishedContent()" would fix it, but obviously put it in the wrong place.
Pagination bug
int postCount;
var posts = PostService.Instance.GetPosts(IPublishedContentHelper.GetNode((int)Model.Id), tag, label, author, searchTerm, commenter, year, month, day, out postCount).Skip((page - 1) * itemsPerPage).Take(itemsPerPage).ToIPublishedContent(true);
Looks like postCount contains count of all posts, even not published ones. I'm trying to prepare my publishing ahead, and my first page is now empty. (while I just have 1 published record)
I'm actually quick-fixing it by setting big items-per-page for now while I'm waiting for a good fix.
One of the ways I found is to set supportUnpublished="false" in Examine config. I totally don't understand what other things it might influence, I will not use this solution.
Other good thing would be to change your code like
private IEnumerable<DynamicNode> GetDescendentsOrSelf(
...
if (child.NodeTypeAlias == targetAlias && child.SomeWayToKnowIsNodePublished)
But there are no such property I found. And I totally thought Nodes are some active entities that are in cache or something, and they must be published already to be there. Document type, on other hand, does have IsPublished boolean, according to manual.
That code is depressing me. I was sure it just must be simple 10 lines of code to implement blog backend on CMS...
Thanks for reporting this... the issue is that i'm getting examine results using the internal index which indexes published and unpublished nodes. I thought the "ToIPublishedContent()" would fix it, but obviously put it in the wrong place.
is working on a reply...