So I am trying to bring back a list of Bucket Items and map them using Glass Mapper.
A couple of issues I am running into. I tried as you can see using the News
glass model, but I get back several thousand records instead of just the one I have now.
The records returned are empty. So that is probably incorrect. If you look at the count variable with that I get back two records one being the News item I expect and the other is the standard values of the News item. I believe I am on the right track as Bucket Items get put in the index, but not sure how to map this correctly to Glass Mapper. Any ideas?
using (var context = ContentSearchManager.GetIndex("sitecore_web_index").CreateSearchContext())
{
var newsitems = context.GetQueryable<Models.sitecore.templates.Feature.News.News>().ToList();
var count = context.GetQueryable<SearchResultItem>().Count(item => item.TemplateId == INewsConstants.TemplateId)
}
News
template setup?