Try our conversational search powered by Generative AI!

Episerver Find: Get PageData from UnifiedSearchResult


Hi there,

Not sure if I'm missing something simple here, does anyone know an efficient way of getting the PageData or IContent reference from a Unified Search result in Episerver Find?

I know one way it could be done is doing a content repository lookup from the URL, but I would've thought the UnifiedSearchResult object would include a content reference buried  somewhere in the results?


Edited, Apr 26, 2018 17:30

Moved post to Episerver Find forum.

Apr 26, 2018 17:52
public static T GetOriginalObject<T>(this UnifiedSearchHit hit)
    if (hit.OriginalObjectGetter != null)
        var original = hit.OriginalObjectGetter.Invoke();

        if (original is T)
            return (T)original;

    return default(T);
Apr 26, 2018 20:30

How would I impliment this in the Alloy FindSearchPage?

I'd love to have more complete sample code for Find.

Jun 22, 2018 17:11
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.