What type for Kentico.Search.searchResultItem

Alistair DeJonge asked on June 28, 2018 17:52

I have recently upgraded from 9 to 10 and I was using Kentico Search 1.0 NuGet Package and now it is updated to Kentico Search 2.0. I was using the Kentico.Search.SearchResultItem as an IEnumerable, but it is now asking for a type. I am not a very experienced developer and am doing this upgrade because we are currently a couple of men down and I had to take over.

In our SearchResults Model we had:

public IEnumerable<Kentico.Search.SearchResultItem> Items
{
    get;
    set;
}

That is now causing a build error and is requiring a type.

Additionally, in our controller we have multiple occasions of created new Lists of SearchResultItem type, as well as declaring new SearchResultItems like so:

SearchResultItem lclItem = new SearchResultItem();

What should I be changing these to?

Recent Answers


Zach Perry answered on June 28, 2018 21:21

It sounds like the search was created following the documentation for K9, You might want to start by comparing the documentation on search for MVC between the two versions:

K9 Documentation

K10 Documentation

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.