I am facing a weird(might not be weird for experienced people) issue where ContentSearch API is returning null value for few fields while I can see the correct values in Solr. The fields whose values are returning as null are of String type because of Sitecore field type as Droplist and Treelist. Wondering if there is anything obvious I am missing somewhere?
Search Result Class:
public class BlogSearchModel
{
//Blog Specific
[IndexField("title_t")]
public string Title { get; set; }
[IndexField("excerpt_t")]
public string Excerpt { get; set; }
[IndexField("body_t")]
public string Body { get; set; }
[IndexField("author_s")]
public string Author { get; set; }
[IndexField("category_s")]
public string Category { get; set; }
[IndexField("tags_sm")]
public IEnumerable<string> TagID { get; set; }
}
Here Author, Category, TagID whose value is returning as Null have inherited templates.
The solr log shows the query as:
Solr Query - ?q=((site_sm:("xxxxx") AND _templates:("795b38b1aca6433fb5f1e02ee350857d")) AND (body_t:(*blog1*) OR title_t:(*blog1*) OR excerpt_t:(*blog1*))) AND _val_:__boost&start=0&rows=1000000&fl=tags,_templates,author_t,_fullpath,_name,__created_by_s,title_t,_template,site_sm,category_t,excerpt_t,_language,body_t,itemurl_t,_uniqueid,_datasource&fq=_indexname:(sitecore_master_index)&wt=xml