Quantcast
Viewing all articles
Browse latest Browse all 6894

GetResult when some items are IContentData and some are not

Hey.

I've created a common interface, ISearchHit. It has a few custom filtering options as well as a few fields related to actually displaying the search hit. Some page types implement this interface, and also some ordinary C# objects that are indexed manually.

The problem is with Search<ISearchHit>().ApplyFilters().GetResult(). GetResult will throw exceptions when it tries to deserialize the hits that are also IContentData. This forum says you should use .GetContentResult to get around this problem. But ISearchHit isn't necessarily IContentData and isn't even compiled as such.

I've also attempted to use UnifiedSearch rather than the normal search, but the whole ISearchContent deal really isn't what I need. I already have a common interface I want to work with. Plus, using unified search gives other problems, such as OriginalObjectGetter begin <null> for my manually indexed objects.

What is the preferred way of doing this kind of search?

I use EPiServer 9 and EPiServer Find 12.2.4.


Viewing all articles
Browse latest Browse all 6894

Trending Articles