November Happy Hour will be moved to Thursday December 5th.

UnifiedSearchHit, i want more details about my hits

Vote:
 

When implementing a global search using Unified search i get a list of UnifiedSearchHit as a searchresult. Most of the properties in UnifiedSearchHit is useful to me but i would like to add a few more.

I know i can customize the data in the UnifiedSearchHit by using a Custom projection or by giving the different types different implementations of ISearchContentproperties

Is it possible to achive this somehow?

#70923
May 03, 2013 14:08
Vote:
 

As far as I know you can only hi-jack and use the properties already in place on UnifiedSearchHit. Among those you have some dictionary type properties that you can use to append stuff to as well.

I think the smoothest way is to add extension methods with the same name.

#70964
Edited, May 06, 2013 14:02
Vote:
 

I found a way to access the original pagetype using the OriginalObjectGetter property on UnifiedSearchHit.

public static int? GetIntranetId(this UnifiedSearchHit hit)
        {
            if(hit.OriginalObjectGetter != null)
            {
                var original = hit.OriginalObjectGetter.Invoke() as SitePageData;
 
                if (original != null)
                    return original.SearchIntranetId;
            }
            return null;
        }

I guess this might work.

#70978
May 06, 2013 17:23
Vote:
 

Hi, is there a way to do this yet?

I've indexed a bunch of external content so that we can use a nice unified search solution and I would like to rebuild the original objects from the search hits to get to the custom properties of the items. The OriginalObjectType is set correctly, but the OriginalObjectGetter is null

Thanks!

Dirk

#201095
Edited, Feb 05, 2019 16:27
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.