I'm upgrading a Sitecore 9.3 solution to Sitecore 10.2. The solution uses Unicorn, Leprechaun, and Synthesis for ORM. As part of the upgrade, Synthesis was updated from 9.1.0.0 to 9.1.6.0.
Everything seems to work except for Synthesis SOLR search.
C#
using (var context = ContentSearchManager.CreateSearchContext(new SitecoreIndexableItem(settingContainer.InnerItem)))
{
indexname = context.Index.Name;
var hits = context.GetSynthesisQueryable<IStandardTemplateItem>()
.Where(x => x.AncestorIds.Contains(settingContainer.Id))
.Where(x => x.TemplateIds.Contains(settingTemplateID))
.GetResults()
.Hits;
setting = hits.FirstOrDefault()?.Document;
// 'setting' used to return a strongly typed implementation of the underlying item if available
// so I could do this:
var x = setting as ISiteHeaderItem
}
The setting
variable now gets back a StandardTemplateItem
object instead of the strongly typed object I used to get before the upgrade.
Digging through the Synthesis.Solr
source code I found the spot where it should be mapping the search result to my strong type. Debugging with this leads to a confusing result:
Line 20 makes the call to the mapper which instantiates the strong type. However, it performs this mapping by reading the _template
field of the document from the SOLR result. As you can see from the screenshot, there is no _template
field.
Does anyone know why? And/or how to resolve this?
Things I have tried:
- Re-Populated SOLR Managed Scheme
- Re-Indexed all SOLR indexes