Using Glass Mapper with Solr Sitecore 8

Using Glass Mapper with Solr Sitecore 8

When using Solr search provider in Sitecore 8 and also using the excellent Glass mapper for Sitecore the documentation on the Glass site walks you through creating a custom search result class with property attributes for search and glass here

Custom Search Class

The ID property has the attribute [IndexField("_id")], this attribute does not work with Solr and should be replaced with   [IndexField("_group")]

A quick look at the SearchResultItem class in the Sitecore.ContentSearch dll shows why.

SearchResultItem