Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

The UnifiedSearchHit.MetaData property doesn't get included in search results

$
0
0

Pardon my newbishness regarding Find embarassed 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<string, IndexValue> MetaData
	{
		get
		{
			var dictionary = new Dictionary<string, IndexValue>
			{
				{"owner", Owner},
				{"...", ...}
			};
			return 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,

SearchClient.Instance.Conventions.UnifiedSearchRegistry.ForInstanceOf()
	.ProjectMetaDataFrom(d => d.MetaData);

Any suggesions for how I can include the extra properties in the search result would be greatly appreciated.

Thank you 


Viewing all articles
Browse latest Browse all 6894

Trending Articles