Pardon my newbishness regarding Find I'm trying to wrap my head around the unified search and doing the one step forward - two steps back dance.
I have a generic .NET class that gets indexed. I have some properites in the class I need to present in the search result and went with the MetaData property on the UnifiedSearchHit class. Problem is it doesn't seem to be returned with the search hits.
My class looks like the example below and the MetaData property is indexed propely. HitTypeName does get included in the search hits but MetaData doesn't.
public class MyVanillaDotNetClass
// Other properties...
public virtual string HitTypeName => FacetTypes.SteeringDocument.ToString();
public virtual IDictionary MetaData
var dictionary = new Dictionary
I've tried messing with the Find initialization both adding ProjectMetaDataFrom as well as IncludeField, though I presume IncludeField only works for typed searches,
.ProjectMetaDataFrom(d => d.MetaData);
Any suggesions for how I can include the extra properties in the search result would be greatly appreciated.
Hmm, I can not see it in the documentation here:
When decompiling I see this:[Obsolete("HitProjectionBuilder ProjectTitleFrom<T> is deprecated, please use IndexProjectionBuilder ProjectTitleFrom<T> instead.")] public static HitProjectionBuilder ProjectTitleFrom<T>(this HitProjectionBuilder builder, Expression<Func<T, string>> sourceExpression)
Maybe it has something to do with this
Thank you for your reply, Henrik. Projecting the title is actually working. The problem I'm facing is how to pass the metadata dictionary from the indexed instances. Other UnifiedSearchHit properties are passed as they should.