I my project I am using Sitecore7 MVC, Solr and Glass Mapper.
The "ContentSearch" index contains pretty much all the fields used in sitecore template. I am using GlassMapper classes as my Models (which contains pretty much nothing but properties that are sitecore fields) and querying on it. Basically doing "Using A Custom Result Class" as described here : http://glass.lu/docs/tutorial/sitecore/tutorial25/tutorial25.html
Which works as it is supposed to.
My question is:
Is it populating the class properties ( which are typically sitecore fields ) using Solr index as long as the index exists (which is what I want) ?
OR
Is it going to sitecore to get the Field Values ? (which I would think is inefficient and in which case I will write custom classes and loop over them to populate glassMapper classes because in my views I have used GlassMapper classes as my models)
For example one of my Models looks like this:
[SitecoreType]
public class MyAwesomeModel
{
[SitecoreId]
[IndexField("_id")]
public virtual Guid Id { get; set; }
[SitecoreInfo(SitecoreInfoType.Language)]
[IndexField("_language")]
public virtual string Language { get; set; }
[TypeConverter(typeof(IndexFieldItemUriValueConverter))]
[XmlIgnore]
[IndexField("_uniqueid")]
public virtual ItemUri Uri { get; set; }
[SitecoreInfo(SitecoreInfoType.Version)]
public virtual int Version
{
get
{
return Uri == null ? 0 : Uri.Version.Number;
}
}
[SitecoreField(FieldName="MyRichtextField")]
[IndexField("MyRichtextField")]
public virtual string RichTextContent { get; set; }
[SitecoreInfo(SitecoreInfoType.Url, UrlOptions = SitecoreInfoUrlOptions.LanguageEmbeddingNever)]
public virtual string Url { get; set; }
}